Closed
Bug 1146544
Opened 9 years ago
Closed 7 years ago
stylesheet/utils.js causes unsafe CPOW usage warnings
Categories
(Add-on SDK Graveyard :: General, defect, P1)
Tracking
(e10s+)
RESOLVED
INCOMPLETE
Tracking | Status | |
---|---|---|
e10s | + | --- |
People
(Reporter: mconley, Unassigned)
References
Details
(Whiteboard: [unsafe-cpow-usage])
function getDOMWindowUtils(window) { return window.QueryInterface(Ci.nsIInterfaceRequestor). getInterface(Ci.nsIDOMWindowUtils); <-- causes unsafe CPOW usage }; function loadSheet(window, url, type) { if (!(type && type in SHEET_TYPE)) type = "author"; type = SHEET_TYPE[type]; if (url instanceof Ci.nsIURI) url = url.spec; let winUtils = getDOMWindowUtils(window); try { winUtils.loadSheetUsingURIString(url, winUtils[type]); <-- causes unsafe CPOW usage } catch (e) {}; }; function removeSheet(window, url, type) { if (!(type && type in SHEET_TYPE)) type = "author"; type = SHEET_TYPE[type]; if (url instanceof Ci.nsIURI) url = url.spec; let winUtils = getDOMWindowUtils(window); try { winUtils.removeSheetUsingURIString(url, winUtils[type]); <-- causes unsafe CPOW usage } catch (e) {}; };
Comment 1•9 years ago
|
||
It would be helpful to include details on how you're seeing this code be called
Flags: needinfo?(mconley)
Reporter | ||
Comment 2•9 years ago
|
||
I believe this test triggers it: https://hg.mozilla.org/mozilla-central/file/e730012260a4/addon-sdk/source/test/test-tabs-common.js#l557
Flags: needinfo?(mconley)
Reporter | ||
Updated•9 years ago
|
tracking-e10s:
m8+ → ---
Whiteboard: [unsafe-cpow-usage]
Reporter | ||
Comment 3•9 years ago
|
||
While it looks like it's a test triggering it, stylesheet/utils.js is used elsewhere in the SDK (by the devtools inspector.js and highlighter.js, it seems), and can be used by any add-on. We should probably make this API cpow-safe, or deprecate it.
tracking-e10s:
--- → ?
Updated•9 years ago
|
Assignee: nobody → wmccloskey
Reporter | ||
Updated•9 years ago
|
Updated•9 years ago
|
Assignee: wmccloskey → nobody
Comment 4•7 years ago
|
||
https://bugzilla.mozilla.org/show_bug.cgi?id=1399562
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•