[Webkit-unassigned] [Bug 137407] New: window.performance object resets script-applied properties

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 3 14:50:36 PDT 2014


https://bugs.webkit.org/show_bug.cgi?id=137407

           Summary: window.performance object resets script-applied
                    properties
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh Intel
               URL: http://jsfiddle.net/dss8wudw/3/
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit Misc.
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: eanakashima at github.com


To polyfill certain browser APIs that are not fully implemented in WebKit, including the User Timing API, it's useful to be able to add properties to the `window.performance` object, using code like `window.performance.mark = function() { [implementation here] }`. In Safari 8 we're seeing a behavior where the `window.performance` object is periodically reset, removing all properties applied with scripts. The point when the reset occurs can vary, but it seems to correlate to: 

- opening and closing the developer tools (console)
- a change in the document readyState
- triggering certain DOM events, e.g. clicking back on the document after you've opened the developer tools

Admittedly it's questionable whether to consider this a bug, since it's typically considered a best practice to not modify built-in browser-provided objects. But it would be really helpful to be able to do this reliably in the case of polyfills.

Steps to Reproduce:

1. Set a property of `window.performance` in a script or in the console. For example, `window.performance.example = "example"`
2. `console.log(window.performance.example)` and see "example" printed
3. Open and close the developer tools (console) a few times.
4. `console.log(window.performance.example)` and see "undefined" printed

See this JS Fiddle http://jsfiddle.net/dss8wudw/3/ for demo setup.

Expected Results:
Ideally `window.performance` properties would remain set unless they are modified by a script (or the user refreshes or navigates to a new page). The value of `window.performance.example` should remain `"example"` until we delete it or set it to something else.

Configuration:

Browser: Safari Version 8.0 (10600.1.22)
OS: Mac OS X 10.10
Device: MacBook Air (11-inch, Mid 2012)

-- 
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