[Greasemonkey] Changing existing Javascript code

Nikolas Coukouma lists at atrus.org
Wed Jan 18 13:59:09 EST 2006


Andrew Ducker wrote:
> I have a script here:
> http://www.notzen.com/andrew/LiveJournalBlockQuote.user.js
>
> You can test if by going here:
> http://andrewducker.livejournal.com/1031325.html?mode=reply
I suggest changing @include to "http://*.livejournal.com/*" so your 
script runs
>
> Select some text, and hit the Quote button.  If there's a newline then 
> it uses <blockquote>, if not it uses <q>.
>
> My script _should_ be changing this behaviour to use "blockquote" all 
> the time.
>
> It doesn't work.
>
> Now, it's definitely doing the right replace - if you check the log 
> afterwards, the page has been changed to have the replaced code. 
> However, the actual running code seems to be the version _before_ my 
> change.
>
> Does Firefox cache any javascript code in a page, making it impossible 
> to change it?  Or am I missing something obvious?
I'm not quite sure why, but on* attributes are a bit weird about their 
scope ... I should examine it more.

For now, here's a version that uses a cleaned up version of 
LiveJournal's code (no need for cross-browser support), blows away the 
old handlers, and installs the new one.

Cheers,
-Nikolas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LiveJournalBlockQuote.user.js
Type: application/x-javascript
Size: 1924 bytes
Desc: not available
Url : http://mozdev.org/pipermail/greasemonkey/attachments/20060118/c28c44d0/LiveJournalBlockQuote.user.js


More information about the Greasemonkey mailing list