Open GoogleCodeExporter opened 9 years ago
Sorry, this report doesn't make much sense to me. Can you provide minimal
example extensions as a test case? Also, Scriptify doesn't directly use
Greasemonkey metadata, and the "run-when" directive in scriptify.json does not
support "document-start", so I don't see how that can be relevant.
Original comment by maglion...@gmail.com
on 19 Oct 2013 at 7:29
> and the "run-when" directive in scriptify.json does not support
"document-start"
Hmmm... may be this may happens for any UserScript.
Example extension: http://infocatcher.ucoz.net/test/ext/test-scriptify.xpi
(from "Test UserScript" described above)
Then set devtools.chrome.enabled = true in about:config, open Tools -
Web-Developer – Scratchpad (Shift+F4), set Environment - Browser and execute
"Test code" from my first message.
setTimeout(..., 0) will happens before addTab().
(I need some way to detect opened tabs after drag-and-drop or calls like
BrowserOpenTab())
Original comment by infocatc...@gmail.com
on 19 Oct 2013 at 7:42
Well, in the case of that extension, the "run-when" directive is simply
ignored, since it doesn't contain a recognized value. As for the console
output, can you try using `dump()` instead? The console service does some
queueing, and does not dispatch the messages synchronously. Any number of
things could be going on.
My best guess is that, if the Scriptify shim is causing this, something is
causing `processNextEvent()` to be called while scripts are being loaded. The
only code in Scriptify which should cause that is the synchronous
`XMLHttpRequest` which occurs if `getResourceText()` is called (which does not
happen in the example add-on). The only other possible explanation I can think
of would be the subscript loader similarly spinning the event loop which, to my
knowledge, it never has and still does not.
Original comment by maglion...@gmail.com
on 19 Oct 2013 at 8:52
> can you try using `dump()` instead?
With
function _log(s) {
...
dump("[test] " + timestamp + " " + s + "\n");
}
With enabled test extension:
[test] 02:47:606 setTimeout()
[test] 02:47:607 addTab()
[test] 02:47:613 setTimeout() done
[test] 02:47:634 addTab() done
[test] 02:51:629 setTimeout()
[test] 02:51:629 addTab()
[test] 02:51:636 setTimeout() done
[test] 02:51:652 addTab() done
With disabled test extension:
[test] 02:56:142 setTimeout()
[test] 02:56:142 addTab()
[test] 02:56:164 addTab() done
[test] 02:56:167 setTimeout() done
[test] 02:58:580 setTimeout()
[test] 02:58:580 addTab()
[test] 02:58:591 addTab() done
[test] 02:58:603 setTimeout() done
Anyway, this is just a simple testcase, because I already see result of this
issue with installed Private Tab extension:
https://addons.mozilla.org/addon/private-tab/
+ already posted https://github.com/Infocatcher/Private_Tab/issues/110
Original comment by infocatc...@gmail.com
on 19 Oct 2013 at 9:10
> With ...
> dump(...)
And browser.dom.window.dump.enabled = true, of course.
Original comment by infocatc...@gmail.com
on 19 Oct 2013 at 9:12
> Well, in the case of that extension, the "run-when" directive is simply
ignored, since it doesn't contain a recognized value.
You're right, the same happens for extensions, based on user.js without @run-at
directive:
https://github.com/Infocatcher/Private_Tab/issues/110#issuecomment-26698774
Original comment by infocatc...@gmail.com
on 21 Oct 2013 at 8:08
Seems like I can't modify issue's title...
Please change it to something like "Works strange with setTimeout() and
gBrowser.addTab(): setTimeout's callback is called before adding of a new tab".
Original comment by infocatc...@gmail.com
on 21 Oct 2013 at 8:13
Interesting, works fine with "manager = new GlobalManager;":
--- a/bootstrap.js
+++ b/bootstrap.js
@@ -944,11 +944,11 @@
// The Message manager on Gecko <8.0 won't accept message listeners
// from sandbox compartments.
- if (Services.vc.compare(Services.appinfo.platformVersion, "10.*")
< 0
- && Services.appinfo.name != "Fennec")
+ //if (Services.vc.compare(Services.appinfo.platformVersion,
"10.*") < 0
+ // && Services.appinfo.name != "Fennec")
manager = new GlobalManager;
- else
- manager = new SlaveDriver;
+ //else
+ // manager = new SlaveDriver;
}
this.shutdown = function shutdown(data, reason) {
Original comment by infocatc...@gmail.com
on 21 Oct 2013 at 8:56
Original issue reported on code.google.com by
infocatc...@gmail.com
on 19 Oct 2013 at 7:04