Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1286)

Side by Side Diff: docs/dealing_with_greasemonkey.md

Issue 1309473002: WIP: Migrate Wiki content over to src/docs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # Introduction
2
3 Lots of users still complain that Chrome does not support Greasemonkey user scri pts. Even though we have had the infrastructure in place to handle user scripts for some time now, it has never been clear how the feature would relate to full extensions, and so it has remained incomplete.
Bons 2015/08/20 20:16:50 propose to delete due to the age of the doc
4
5 http://crbug.com/16344 was the previous proposal for rationalizing these two fea tures, but many team members disliked it due to the result of maintaining two pa rallel systems.
6
7 This new proposal is on how we can transparently convert existing .user.js files into extensions. This would make Greasemonkey user script support a first-class feature in Chrome.
8
9
10 # Details
11
12 Our goal is to be able to click on a .user.js file on the web, get a Chrome exte nsion install experience, and from that point on have a normal, fully-functionin g Chrome extension.
13
14 A Greasemonkey user script includes:
15
16 1. A unique name (using XML-style namespaces)
17 1. A single script file
18 1. Some include and exclude rules that control where it runs
19 1. References to some Greasemonkey-specific APIs
20
21 A Chrome extension with similar functionality to a Greasemonkey script includes:
22
23 1. A randomly-generated unique public key
24 1. A unique ID which is a fingerprint of its public key
25 1. Some match patterns that control where it runs (mostly compatible with Grea semonkey syntax but different in details)
26 1. One or more physical JS files
27
28 It should be possible for Chrome to transparently convert a Greasemonkey script into an extension like so:
29
30 1. Hash the user script's unique name into a public key.
31 * It is important to hash the name instead of generating a random public key so that if a user script is overinstalled, Chrome will detect it as an overinst all.
32 * There will be no corresponding private key, but that is OK since user scri pts do not update.
33 1. Convert Greasemonkey include rules into Chrome extension match patterns. In cases where this isn't possible, use a match pattern that matches everything an d evaluate the Greasemonkey rule in JavaScript.
34 1. Include a small Greasemonkey emulation layer for the Greasemonkey-specific APIs (we already have this implemented).
35
36 With all this in place, we could remove the support for the existing --enable-us er-scripts feature, which would simplify lots of our code.
37
38 We could also in the future add a developer tool to start a new Chrome extension based on an existing Greasemonkey user script.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698