Remove String.prototype.quote

RESOLVED FIXED in mozilla37

Status

()

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: evilpie, Assigned: evilpie)

Tracking

(Blocks: 1 bug, {addon-compat, dev-doc-complete, site-compat})

unspecified
mozilla37
addon-compat, dev-doc-complete, site-compat
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 3 obsolete attachments)

Comment hidden (empty)
(Assignee)

Comment 1

4 years ago
Assignee: nobody → evilpies
Status: NEW → ASSIGNED
(Assignee)

Comment 2

4 years ago
I am basically convinced we can remove this here and now. We have almost no uses in the browser and very low add-on usage. No other browser implements this either.
(Assignee)

Comment 3

4 years ago
Attachment #8527034 - Attachment is obsolete: true
Keywords: dev-doc-needed, site-compat
(Assignee)

Updated

4 years ago
Attachment #8527033 - Flags: review?(jorendorff)
(Assignee)

Updated

4 years ago
Attachment #8527037 - Flags: review?(wjohnston)
Attachment #8527033 - Flags: review?(jorendorff) → review+
(Assignee)

Updated

4 years ago
Attachment #8527037 - Attachment is obsolete: true
Attachment #8527037 - Flags: review?(wjohnston)
(Assignee)

Comment 4

4 years ago
Attachment #8532044 - Flags: review?(rnewman)
(Assignee)

Comment 5

4 years ago
Comment on attachment 8532044 [details] [diff] [review]
v2 - Remove quote browser/mobile usage

I believe pref names are relatively sane, so we don't need to escape anything.
Attachment #8532044 - Attachment description: remove-quote-browser → v2 - Remove quote browser/mobile usage
Comment on attachment 8532044 [details] [diff] [review]
v2 - Remove quote browser/mobile usage

Review of attachment 8532044 [details] [diff] [review]:
-----------------------------------------------------------------

::: mobile/android/chrome/content/config.js
@@ +86,5 @@
>        return;
>      }
>  
>      // If item already in list, it's being changed, else added
> +    let item = document.querySelector(".pref-item[name=\"" + aPrefName + "\"]");

I'm not particularly happy removing this quoting without figuring out an alternative: finding another escaping method, or mapping keys in a more sophisticated way that doesn't require escaping.

I tested. about:config allows me to create prefs with backslashes and quotes in their names, and there is certainly an extant pattern to have computed pref names like:

  extensions.bookmarkdeduplicator@foxhatdev.install-event-fired

or

  urlclassifier.keyupdatetime.https://sb-ssl.google.com/safebrowsing/getkey?client=navclient-auto-ffox2.0&


In short: this is a change you need to _prove_ is safe, because I see nothing to suggest that it won't break.
Attachment #8532044 - Flags: review?(rnewman) → review-
(Assignee)

Comment 7

4 years ago
Okay let's use CSS.escape there as well. I indeed didn't consider this case. I don't consider about:config to be critical anyway.

CSS.escape(' \\"') gives "\ \\\\""
(Assignee)

Comment 8

4 years ago
Attachment #8532044 - Attachment is obsolete: true
Attachment #8532111 - Flags: review?(rnewman)
Attachment #8532111 - Flags: review?(rnewman) → review+
https://hg.mozilla.org/mozilla-central/rev/7794fca7bda8
https://hg.mozilla.org/mozilla-central/rev/3bdce03e9ec0
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla37

Updated

4 years ago
Keywords: dev-doc-needed → dev-doc-complete
Depends on: 1108416
Keywords: addon-compat
You need to log in before you can comment on or make changes to this bug.