[Webkit-unassigned] [Bug 128303] New: Replacing `navigator` is buggy
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Feb 6 03:17:08 PST 2014
https://bugs.webkit.org/show_bug.cgi?id=128303
Summary: Replacing `navigator` is buggy
Product: WebKit
Version: 528+ (Nightly build)
Platform: Macintosh Intel
OS/Version: Mac OS X 10.9
Status: NEW
Severity: Major
Priority: P2
Component: JavaScriptCore
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: radexpl at gmail.com
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.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list