WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
128303
REGRESSION (
r160879
): Replacing 'navigator' doesn't work, breaks Cordova library
https://bugs.webkit.org/show_bug.cgi?id=128303
Summary
REGRESSION (r160879): Replacing 'navigator' doesn't work, breaks Cordova library
Radek Pietruszewski
Reported
2014-02-06 03:14:27 PST
Hello, A library I'm using (Cordova) does this:
> var CordovaNavigator = function() {}; > CordovaNavigator.prototype = window.navigator; > window.navigator = new CordovaNavigator();
I'm not sure why it does that (the comment above says: "Replace navigator before any modules are required(), to ensure it happens as soon as possible. We replace it so that properties that can't be clobbered can instead be overridden.", but I'm not sure what that means), but it's always worked fine. It works on Safari 6 and 7, on iOS 6, 7, 7.1b4 and on Android, but on the latest nightlies (
r163498
is the newest I checked) it breaks. All method calls and property accesses throw TypeError and typing `navigator` in Inspector's console returns vague "Error". I'm not a JS expert, but AFAICT it appears to be a WebKit bug. I attached a test case.
Attachments
test case
(521 bytes, text/html)
2014-02-06 03:15 PST
,
Radek Pietruszewski
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Radek Pietruszewski
Comment 1
2014-02-06 03:15:15 PST
Created
attachment 223323
[details]
test case
Alexey Proskuryakov
Comment 2
2014-02-10 10:35:39 PST
This regressed in <
http://trac.webkit.org/r160879
>.
Radek Pietruszewski
Comment 3
2014-06-05 13:16:35 PDT
This shipped in iOS 8 beta and breaks a lot of apps. Hoping for a fix in seed 2!
Radek Pietruszewski
Comment 4
2014-07-02 09:54:43 PDT
Fixed (sometime between iOS 8 beta 1 and 2, apparently).
Oliver Hunt
Comment 5
2014-07-02 09:56:00 PDT
(In reply to
comment #4
)
> Fixed (sometime between iOS 8 beta 1 and 2, apparently).
Yeah, there's another similar bug that i should have duped this to - please file bugs on any other weirdness you encounter :D
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug