Last Comment Bug 776389 - Function.toString() fails , Error: [Exception... "The URI is malformed" nsresult: "0x804b000a (NS_ERROR_MALFORMED_URI)"...
: Function.toString() fails , Error: [Exception... "The URI is malformed" nsre...
Status: RESOLVED FIXED
: addon-compat, regression
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: 17 Branch
: x86 Windows 7
: -- normal with 1 vote (vote)
: mozilla17
Assigned To: general
:
Mentors:
Depends on: 776430 776439
Blocks: savesource
  Show dependency treegraph
 
Reported: 2012-07-22 12:42 PDT by Alice0775 White
Modified: 2012-07-23 17:14 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
JavaScript file should be placed into profile_folder\chrome (264 bytes, application/x-javascript)
2012-07-22 12:42 PDT, Alice0775 White
no flags Details
Standalone xpi to easily reproduced (3.04 KB, application/x-xpinstall)
2012-07-22 13:24 PDT, Alice0775 White
no flags Details
load subscripts (2.50 KB, patch)
2012-07-22 14:41 PDT, :Benjamin Peterson
bzbarsky: review+
Details | Diff | Review

Description Alice0775 White 2012-07-22 12:42:28 PDT
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
Comment 1 Alice0775 White 2012-07-22 13:03:39 PDT
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
Comment 2 Alice0775 White 2012-07-22 13:24:02 PDT
Created attachment 644784 [details]
Standalone xpi to easily reproduced

Simple STR
1. Start Firefox with clean profile
2. Install attached Standalone xpi
3. Restart
Comment 3 Boris Zbarsky [:bz] (Out June 25-July 6) 2012-07-22 13:27:34 PDT
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 :Benjamin Peterson 2012-07-22 14:41:55 PDT
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...
Comment 5 Boris Zbarsky [:bz] (Out June 25-July 6) 2012-07-22 15:11:30 PDT
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?
Comment 7 Ryan VanderMeulen [:RyanVM] 2012-07-22 19:04:24 PDT
https://hg.mozilla.org/mozilla-central/rev/d12d918df9d6

Note You need to log in before you can comment on or make changes to this bug.