Giter Site home page Giter Site logo

.meta.js about openuserjs.org HOT 8 CLOSED

openuserjs avatar openuserjs commented on May 9, 2024
.meta.js

from openuserjs.org.

Comments (8)

cletusc avatar cletusc commented on May 9, 2024

Here is some skeleton logic for when this gets implemented, feel free to use or abuse. Ref #3 for serving installs.

// .user.js
exports.install = function (request, response) {
    if (!scriptExists) {
        response.send(404);
    }
    if (request.accepts('text/x-userscript.meta')) {
        // Forward request to meta routine.
        // ...
        return;
    }

    // Pull script source.
    // ...

    // Increase install count.
    // ...

    response.set('Content-Type', 'text/javascript');
    response.send(200, scriptSource);
}

// .meta.js
exports.meta = function (request, response) {
    if (!scriptExists) {
        response.send(404);
    }

    // Pull script source.
    // ...

    // Increase install count.
    // ...

    if (request.accepts('text/x-userscript.meta')) {
        response.set('Content-Type', 'text/x-userscript.meta');
    }
    else {
        response.set('Content-Type', 'text/plain');
    }
    response.send(200, scriptSource);
}

from openuserjs.org.

sizzlemctwizzle avatar sizzlemctwizzle commented on May 9, 2024

We should respond with a content-type of text/javascript for both. The accept header is just for knowing what they want. Also you left in the same comments for meta as script. We only increment the install counter when accept is not text/userscript-meta. This is the only time we shouldn't increment the counter for a request of the .user.is file imo.

from openuserjs.org.

cletusc avatar cletusc commented on May 9, 2024

I actually meant that to be there, but not for installs (it should have said meta install count). In short: a monthly estimated active users count in addition to the normal total installs. I'll branch that off into a separate issue/discussion though.

Edit: discussion posted here.

from openuserjs.org.

sizzlemctwizzle avatar sizzlemctwizzle commented on May 9, 2024

An update install would still count as an install, but I think we can ignore automated update checks.

I'll branch that off into a separate issue/discussion though.

Google Groups preferably.

from openuserjs.org.

sizzlemctwizzle avatar sizzlemctwizzle commented on May 9, 2024

Pardon the forced updates. I had to clean up after after myself.

from openuserjs.org.

jerone avatar jerone commented on May 9, 2024

This doesn't seems to work anymore... anyone can confirm?

Also; GreaseMonkey will standard have .meta.js support, greasemonkey/greasemonkey#1885

from openuserjs.org.

jerone avatar jerone commented on May 9, 2024

This doesn't seems to work anymore... anyone can confirm?

Nvm, found how it works again; is on a different path. Then greasemonkey/greasemonkey#1885 will probably not work.

from openuserjs.org.

sizzlemctwizzle avatar sizzlemctwizzle commented on May 9, 2024

We already support greasemonkey/greasemonkey#1824 for this, and it has already been pulled and released (1.15).

from openuserjs.org.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.