[Greasemonkey] Long literal strings of html

Julien Couvreur julien.couvreur at gmail.com
Wed Apr 20 12:49:23 EDT 2005


On 4/16/05, Aaron Boodman <zboogs at gmail.com> wrote:
> I actually missed the part above where you talked about the template
> syntax, so that's where the disconnect was. It's an interesting idea.
> 
> Let me let it percolate for awhile.

How's the percolation going? ;-)

I looked at the implementation details.
Note: this is just a prototype, I don't think we'd want to keep a
GM_getRawScript function.

GM_getRawScript (in browser.xul in the "injectScript" function) below
shows how to get the raw content of the script, the same way that GM
does for injecting it into the page (so it won't break even if GM
changes the way it injects the script into the page).
            win.GM_log (...)
            win.GM_getRawScript = function() {
              return getContents(getScriptChrome(script.filename));
            }
            runBrowserScript(...

Combining this code with a simple extraction of literal strings (as
shown in samples in this thread) would make it easy to write a
GM_getLiteralString(name).

So it's just a matter of deciding:
- if we want this kind of support for literal string in GM,
- what specific format to use (do we want to offer an escape sequence
for /* and */ in the literal strings?).

Let me know and I can get a patch ready,
Julien


More information about the Greasemonkey mailing list