Closed
Bug 1140796
Opened 11 years ago
Closed 10 years ago
Cannot set content ImageData from an array created in browser/chrome scope - Error: Permission denied to access property "length"
Categories
(Core :: General, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: noitidart, Unassigned)
Details
(Keywords: testcase, Whiteboard: [invalid?])
Attachments
(1 file)
|
4.41 KB,
text/javascript
|
Details |
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0
Build ID: 20150302192546
Steps to reproduce:
Copy paste the attached code to Scratchpad.
Run it in Environment>Content scope
it works, scroll down to the current focused tab and you'll see a firefox icon drawn 16x16px (its partial firefox icon)
Change Environment>Browser run it, now get
Now change scope to
Actual results:
/*
Exception: Error: Permission denied to access property "length"
@Scratchpad/9:31
*/
Comment 1•11 years ago
|
||
I think this is expected, since you're passing a chrome array to a content method:
var doc = gBrowser.contentDocument;
var canvas = doc.createElement('canvas');
doc.body.appendChild(canvas);
var ctx = canvas.getContext('2d');
var idata = ctx.createImageData(16, 16);
var normalArr = [];
...
idata.data.set(normalArr);
If you define the array as:
var normalArr = new doc.defaultView.Array();
- it will work (until e10s lands).
Keywords: testcase
Product: Firefox → Core
Summary: Cannot set ImageData from browser scope → Cannot set content ImageData from an array created in browser/chrome scope - Error: Permission denied to access property "length"
Whiteboard: [invalid?]
thanks for those notes nickolay! ya it makes sense, i just wish there was someway to use canvas without needing a document. especially using canvas in a ChromeWorker
Comment 3•10 years ago
|
||
Based on the last 2 comments I'm setting the status of this issue to Resolved Invalid.
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
Comment 4•8 years ago
|
||
Moving from Core::Untriaged to Core::General https://bugzilla.mozilla.org/show_bug.cgi?id=1407598
Component: Untriaged → General
You need to log in
before you can comment on or make changes to this bug.
Description
•