Function.toString() fails , Error: [Exception... "The URI is malformed" nsresult: "0x804b000a (NS_ERROR_MALFORMED_URI)"...

RESOLVED FIXED in mozilla17

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Alice0775 White, Unassigned)

Tracking

({addon-compat, regression})

17 Branch
mozilla17
x86
Windows 7
addon-compat, regression
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Reporter)

Description

5 years ago
Created attachment 644779 [details]
JavaScript file should be placed into profile_folder\chrome

Build Identifier:
http://hg.mozilla.org/mozilla-central/rev/462106f027af
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Firefox/17.0 ID:20120722030555

When a JavaScript file is loaded by UC (https://addons.mozilla.org/en-US/firefox/addon/uc/),
Function.toString() fails.

Steps to Reproduce:
1. Start Nightly with new profile
2. Install UC(https://addons.mozilla.org/en-US/firefox/addon/uc/)
3. Create "chrome" folder in the profile folder
4. Copy attached file to created "chrome" folder in the profile folder
5. Restart Browser

Actual Results:
 Only two alert box appear:
  1st: object
  2nd: function

And the following error in the Error Console

Timestamp: 2012/07/23 4:17:17
Error: [Exception... "The URI is malformed"  nsresult: "0x804b000a (NS_ERROR_MALFORMED_URI)"  location: "JS frame :: resource://uc/uc.jsm -> file:///C:/Users/fuku/AppData/Roaming/Mozilla/Firefox/Profiles/zgmphg9g.Default%20User/chrome/bug.test.uc.js?1342984023485 :: <TOP_LEVEL> :: line 8"  data: no]
Source File: resource://uc/uc.jsm
Line: 206

Expected results: 
 Three alert box appear:
  1st: object
  2nd: function
  3rd:
       function (aEvent, aXferData, aDragSession) {
       }

And No error in the Error Console

Regression window(m-i)
Good:
http://hg.mozilla.org/integration/mozilla-inbound/rev/6e09c52e2c73
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Firefox/17.0 ID:20120720111908
Bad:
http://hg.mozilla.org/integration/mozilla-inbound/rev/f9b341d6babd
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Firefox/17.0 ID:20120720112708
Pushlog:
http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=6e09c52e2c73&tochange=f9b341d6babd
(Reporter)

Comment 1

5 years ago
This also affected userChromeJS( http://userchromejs.mozdev.org/index.html)

Steps to Reproduce:
1. Start Nightly with new profile
2. Install userChromeJS v1.5(http://userchromejs.mozdev.org/index.html)
3. Quit browser
4. Open the profile folder\chrome\userChrome.js with text editor
     And append the following 2 lines and save.
if (location == "chrome://browser/content/browser.xul")
userChrome.import("*", "UChrm");

5. Copy attached file to the profile folder\chrome\
6. Start Browser with -purgecaches
(Reporter)

Comment 2

5 years ago
Created attachment 644784 [details]
Standalone xpi to easily reproduced

Simple STR
1. Start Firefox with clean profile
2. Install attached Standalone xpi
3. Restart
Mmm.  Yeah, for subscripts, the script filename isn't a URI at all.

I wonder whether we can drop that prefixing bit there...

Comment 4

5 years ago
Created attachment 644795 [details] [diff] [review]
load subscripts

I'm not sure if I'm allowed to use C stdlib string functions. It seemed trivial enough without the ns*String hammer...
Attachment #644795 - Flags: review?(bzbarsky)
Comment on attachment 644795 [details] [diff] [review]
load subscripts

This seems fine, though please file a followup on getting rid of this hack if we can stop prefixing subscripts?
Attachment #644795 - Flags: review?(bzbarsky) → review+

Comment 6

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/d12d918df9d6
https://hg.mozilla.org/mozilla-central/rev/d12d918df9d6
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
(Reporter)

Updated

5 years ago
Depends on: 776430
(Reporter)

Updated

5 years ago
Depends on: 776439
tracking-firefox17: ? → ---
You need to log in before you can comment on or make changes to this bug.