Closed
Bug 570858
Opened 14 years ago
Closed 14 years ago
ChromeWorker doesn't exist from browser.xul/overlay js
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
blocking2.0 | --- | betaN+ |
People
(Reporter: Mardak, Assigned: bent.mozilla)
References
Details
Attachments
(2 files)
(deleted),
application/x-xpinstall
|
Details | |
(deleted),
patch
|
mrbkap
:
review+
|
Details | Diff | Splinter Review |
We're trying to get a ChromeWorker object to access ctypes, but the object doesn't exist from the overlay or script loaded from the overlay.
If I create a dummy xul chrome page, both Worker and ChromeWorker are there.
Are these supposed to be accessible from the overlay and/or Error Console? We were going to use nsIWindowMediator to grab a browser window to extract the ChromeWorker object because it's not available from a Cu.import script.
Comment 1•14 years ago
|
||
ChromeWorker should definitely be available in all XUL contexts (right now it is only available if you load a XUL page in a browser window, like Mardak says). It would also be cool to have it available in JS modules.
How are you loading the script in question? At first it sounds like this is just a <script> element inside an overlay file, but then you are saying that you are using Components.utils.import.
Comment 3•14 years ago
|
||
ChromeWorker isn't available in the context of a <script> in an overlay file. Which means getting a hold of it from JS modules by doing something like Services.wm.getMostRecentWindow(null).ChromeWorker, it doesn't work either.
Please lets focus on one issue at a time. If ChromeWorker isn't available in a XUL overlay that just contains a markup like:
<script>
worker = new ChromeWorker();
if (!worker) {
alert("It didn't work");
}
</script>
then that seems like a good place to start.
jst, mrbkap, does scripts in overlays execute in a different context than the main xul document? It surprises me if that is the case.
Comment 5•14 years ago
|
||
I'm not sure it's main XUL document vs overlay. It seems to be more like window XUL vs XUL loaded within the browser.
Comment 6•14 years ago
|
||
Please explain what (In reply to comment #5)
> I'm not sure it's main XUL document vs overlay. It seems to be more like window
> XUL vs XUL loaded within the browser.
Please explain what you mean with "window XUL" vs "XUL loaded within the browser".
Comment 7•14 years ago
|
||
Basically our observation is that ChromeWorker is available in XUL documents that are loaded in a browser content window (e.g. about:config) whereas it's not in a Firefox overlay (which I consider "window XUL").
Comment 8•14 years ago
|
||
Can someone create a test extension or something that shows this problem?
Comment 9•14 years ago
|
||
Here's a test extension. When you start Firefox, it should dump() "ChromeWorker is [object ChromeWorker]" to stdout, but what actually happens is you get an exception in the error console:
Error: ChromeWorker is not defined
Source File: chrome://testchromeworker/content/ff-overlay.js
Line: 1
Now, if you type chrome://testchromeworker/content/ff-overlay.xul into the browser location bar, the dump() message appears just fine.
Comment 11•14 years ago
|
||
If this is still an issue, it should block, as this is the last big bit of CPU on the main thread for Sync.
blocking2.0: --- → ?
My impression was that we know what's going on here. Apparently we run overlays in some special type of context. Mrbkap might know more.
Updated•14 years ago
|
Attachment #462187 -
Flags: review?(mrbkap) → review+
Assignee | ||
Comment 15•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•