[Greasemonkey] Gm still not working in JS-created pages

Arvid Jakobsson arvid.jakobsson at gmail.com
Mon Jul 31 13:13:36 EDT 2006


Isn't the problem that DOMContentLoad isn't firing for JS created
pages (or something like that)?

On 7/31/06, Bill Donnelly <donnelly at snowcrest.net> wrote:
> I believe this function in .../content/browser.js is what is causing
> the menu commander attachments and detachments. I don't know why it is
> being called so many times, tho.
>
> However, Gm knows something is occurring, but is not loading/injecting
> the scripts for the new page. I still think it has something to do with
> Gm thinking that the two pages are the same, so it doesn't need to
> load/inject the scripts "again." But the pages are not the same, and they
> are in two different tabs. Why they changed Firefox to show them as having
> the same URL address, I don't know. Although this may not have anything to
> do with why the scripts aren't being loaded/injected into the new tab/page.
>
> /**
>  * The browser's location has changed. Usually, we don't care. But in
> the case
>  * of tab switching we need to change the list of commands displayed in the
>  * User Script Commands submenu.
>  */
> GM_BrowserUI.onLocationChange = function(a,b,c) {
>   if (this.currentMenuCommander != null) {
>     this.currentMenuCommander.detach();
>     this.currentMenuCommander = null;
>   }
>
>   var menuCommander = this.getCommander(this.tabBrowser.selectedBrowser.
>                                         contentWindow);
>
>   if (menuCommander) {
>     this.currentMenuCommander = menuCommander;
>     this.currentMenuCommander.attach();
>   }
> }
>
>
> Bill Donnelly wrote:
> > I'm looking into (again) why Gm isn't being loaded into JS-created pages.
> > When I create a page using a bookmarklet, the following (below) is output
> > to the JS Console when greasemonkey.logChrome is true.
> >
> > Why?
> >
> > What is all of this activity? (Gm is doing something at least (maybe))
> >
> > Does it give a clue as to what may be occurring, or not occurring.
> >
> > (Firefox 1.5.0.5 (new release) with Gm 0.6.5.20060727 (newest release))
> >
> > > GM_MenuCommander.detach
> > ----------
> > * this.menuPopup: [object XULElement]
> > ----------
> > < GM_MenuCommander.detach
> > ----------
> > > GM_MenuCommander.attach
> > ----------
> > < GM_MenuCommander.attach
> > ----------
> > > GM_MenuCommander.detach
> > ----------
> > * this.menuPopup: [object XULElement]
> > ----------
> > < GM_MenuCommander.detach
> > ----------
> > > GM_MenuCommander
> > ----------
> > < GM_MenuCommander
> > ----------
> > > GM_MenuCommander.attach
> > ----------
> > < GM_MenuCommander.attach
> > ----------
> > > GM_MenuCommander.detach
> > ----------
> > * this.menuPopup: [object XULElement]
> > ----------
> > < GM_MenuCommander.detach
> > ----------
> > > GM_MenuCommander.attach
> > ----------
> > < GM_MenuCommander.attach
> >
> > _______________________________________________
> > Greasemonkey mailing list
> > Greasemonkey at mozdev.org
> > http://mozdev.org/mailman/listinfo/greasemonkey
> >
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkey at mozdev.org
> http://mozdev.org/mailman/listinfo/greasemonkey
>


More information about the Greasemonkey mailing list