[Webkit-unassigned] [Bug 195834] Can't use $0, $1 etc when inspecting Google Docs pages because the content uses these for function names

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 26 15:31:24 PDT 2019


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

--- Comment #1 from Devin Rousso <drousso at apple.com> ---
No matter what prefix (e.g. `$`) we pick, there's always a chance that the inspected page (or whatever the current context is) overrides it.  A particularly malicious website could decide to blanket create $0...$99 as empty values on `window` to entirely prevent Web Inspector from being able to save values.

One idea I had was to create a way for the developer to be able to customize the prefix from the Web Inspector frontend (e.g. an <input> in the Settings tab), so that if they notice that there are already existing values on the page, they could change `$` to be `$sadface` and avoid the collision/shadowing.  This would 100% require backend support, but it would be a somewhat easy change to make.  The discoverability of this isn't any worse than any other setting, but telling the "story" of this method would be much harder, specifically with the amount of space we traditionally have for any given setting in the Settings tab (e.g. one line with only a few words).

I like this approach as it gives the most flexibility to the developer (some people would prefer a different prefix, like `_` or `temp` or `joe`).

Alternatively (or in addition to), if we notice that a saved value (e.g. `$1`) would collide with an existing value on the page, we could surface a warning in the console suggesting that the developer change their prefix, or even try to do some smart "expansion" and add as many `_` as needed until there's no collision.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190426/40c8c1c4/attachment.html>


More information about the webkit-unassigned mailing list