Closed Bug 813623 Opened 13 years ago Closed 13 years ago

window.URL.createObjectURL is not a function when going through Xrays (Xrays for static properties don't work)

Categories

(Core :: DOM: Core & HTML, defect)

19 Branch
x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20
Tracking Status
firefox19 + fixed
firefox20 + fixed

People

(Reporter: rmlipman, Assigned: bzbarsky)

References

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:18.0) Gecko/18.0 Firefox/18.0 Build ID: 20121119042013 Steps to reproduce: I tried to use this script in Nightly with Scriptish: http://ms11.github.com/4chanSoundPlayer/ On 4chan there are threads called "sound threads" where you post images with sounds embedded in them. In the post body there are words in [brackets]. Clicking on the words in brackets plays the embedded sounds. The latest known working Nightly build is 2012-11-08. I last tested on 2012-11-20. Aurora has not yet been updated to 19, but since it was broken in Nightly 19 I suspect it might break in Aurora as well. Actual results: Instead of the sounds playing, I get this error in the web console: "TypeError: window.URL.createObjectURL is not a function". I had the script log values and at the runtime of the script window.URL is defined, but window.URL.createObjectURL has a value of undefined. If I check the values on the web console by hand, window.URL and window.URL.createObjectURL are both defined. Expected results: The sound should have played. The easiest way to test this is to go to http://catalog.neet.tv/v/ or http://catalog.neet.tv/a/ and search for "sound" or "[" to find an active sound thread.
Version: 18 Branch → Trunk
Suspected: Bug 810520
Blocks: 792675
Component: Untriaged → DOM
OS: Mac OS X → All
Product: Firefox → Core
Version: Trunk → 19 Branch
So is this only a problem in a Scriptish user script? This should have been resolved in bug 778152, in general....
Keywords: regression
And a small script I tried over here that just does this: // ==UserScript== // @name Test script // @namespace bzbzbz // @include http://www.mozilla.org/* // @version 1 // ==/UserScript== alert(window.URL) alert(window.URL.createObjectURL) works fine for me. I do see the problem with the original script, though... So something is fishy. Can someone try reducing the script to the smallest one that shows the problem?
Keywords: qawanted
I am not sure the following is correct behavior of this bug. Str 1. set devtools.chrome.enabled to true 2. Open a web page 3. Open ScratchPad(Shift+F4) and turn on "Browser" of environment menu 4. Paste alert(content.URL.createObjectURL) 5. Execute > run (Ctrl+R) Actual results: undefined Expected results: function createObjectURL() { [native code] }
(In reply to Boris Zbarsky (:bz) from comment #3) > And a small script I tried over here that just does this: > > // ==UserScript== > // @name Test script > // @namespace bzbzbz > // @include http://www.mozilla.org/* > // @version 1 > // ==/UserScript== > alert(window.URL) > alert(window.URL.createObjectURL) > > works fine for me. I do see the problem with the original script, though... > So something is fishy. > > Can someone try reducing the script to the smallest one that shows the > problem? I can repro with Scriptish 0.1.8 and the small script. Second alert shows "undefined". http://hg.mozilla.org/releases/mozilla-aurora/rev/5f19747d3410 Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/19.0 Firefox/19.0 ID:20121120042014
Using the steps in comment 5 in my debug build I get the expected result, not undefined... Same thing in a 2012-11-19 Mac nightly. :( Something is definitely very fishy...
Aha! Now I've reproduced it in a debug build. Had to make sure about:config wasn't the thing that was still showing in the browser. ;)
Looks like we never actually init the ids in sStaticMethods_ids. I would have thought we had tests for this, but apparently not.
Assignee: nobody → bzbarsky
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: qawanted
Whiteboard: [need review]
Summary: window.URL.createObjectURL is not a function → window.URL.createObjectURL is not a function when going through Xrays (Xrays for static properties don't work)
Attachment #683743 - Flags: review?(peterv) → review+
Flags: in-testsuite+
Whiteboard: [need review]
Target Milestone: --- → mozilla20
Comment on attachment 683743 [details] [diff] [review] Fix Xrays to actually work correctly for static methods and properties. [Approval Request Comment] Bug caused by (feature/regressing bug #): Bug 792675 User impact if declined: Extensions and user scripts can't access certain DOM methods that they used to be able to access. Testing completed (on m-c, etc.): Passes added automated tests, testcases in this bug. Risk to taking this patch (and alternatives if risky): Low risk. Just makes us run the same code for static methods and attributes as we already run for all sort of other methods/attributes. String or UUID changes made by this patch: None.
Attachment #683743 - Flags: approval-mozilla-aurora?
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Comment on attachment 683743 [details] [diff] [review] Fix Xrays to actually work correctly for static methods and properties. [Triage Comment] Will prevent the possibility for new add-on regressions in FF19 caused by Bug 792675.
Attachment #683743 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: