Closed
Bug 1362787
Opened 8 years ago
Closed 8 years ago
Implement chrome.privacy.websites.referrersEnabled
Categories
(WebExtensions :: General, enhancement, P3)
WebExtensions
General
Tracking
(firefox56 fixed)
RESOLVED
FIXED
mozilla56
Tracking | Status | |
---|---|---|
firefox56 | --- | fixed |
People
(Reporter: Manuel.Spam, Assigned: bsilverberg)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-complete, Whiteboard: [privacy]triaged)
Attachments
(1 file)
Implement "chrome.privacy.websites" API as described here:
https://developer.chrome.com/extensions/privacy#property-websites
I want to use this API to create a simple button to toggle sending the Referrer. I prefer to surf with Referrer disabled completely. I toggle it "on" temporarily for sites which force me to use the Referrer.
Updated•8 years ago
|
Flags: needinfo?(bob.silverberg)
Whiteboard: investigating
Assignee | ||
Comment 1•8 years ago
|
||
This is only asking for one of the settings under chrome.privacy.websites, which is `referrersEnabled`, so I am updating the bug title.
Based on my initial research into the privacy API, this can be implemented by changing the pref `network.http.sendRefererHeader` to 0 when set to "false" and to 2 (which is the default) when set to "true".
As this is fairly simple I will take it on and work on implementing it.
Assignee: nobody → bob.silverberg
Blocks: 1363856
Flags: needinfo?(bob.silverberg)
Priority: -- → P3
Summary: Implement chrome.privacy.websites API → Implement chrome.privacy.websites.referrersEnabled
Whiteboard: investigating → [privacy]triaged
Comment hidden (mozreview-request) |
Comment 3•8 years ago
|
||
mozreview-review |
Comment on attachment 8876791 [details]
Bug 1362787 - Implement chrome.privacy.websites.referrersEnabled,
https://reviewboard.mozilla.org/r/148114/#review152604
::: toolkit/components/extensions/ext-privacy.js:123
(Diff revision 1)
> + // When this setting is true, the pref should be set to 2, and when
> + // this setting is false, the pref should be set to 0.
This comment is really not helpful, can you include a reference to docs or code where these values come from.
::: toolkit/components/extensions/test/xpcshell/test_ext_privacy.js:277
(Diff revision 1)
> - async function testSetting(setting, value, truePrefs) {
> + function checkBoolean(value, pref, prefValue, truePrefs) {
> + equal(prefValue, truePrefs.includes(pref), `${pref} set correctly for ${value}`);
> + }
> +
> + function checkSinglePrefValue(value, pref, prefValue, expectedValue) {
> + equal(prefValue, expectedValue, `${pref} set correctly for ${value}`);
> + }
> +
> + async function testSetting(setting, value, checkArgs, checkFn = checkBoolean) {
> extension.sendMessage("set", {value: value}, setting);
> let data = await extension.awaitMessage("settingData");
> equal(data.value, value);
> for (let pref in SETTINGS[setting]) {
> let prefValue = Preferences.get(pref);
> - equal(prefValue, truePrefs.includes(pref), `${pref} set correctly for ${value}`);
> + checkFn(value, pref, prefValue, checkArgs);
> }
> }
This seems unnecessarily roundabout, it might be more verbose but it would be much more clear to just pass in an array or object with the expected values in all cases.
Attachment #8876791 -
Flags: review?(aswan) → review-
Comment hidden (mozreview-request) |
Comment 5•8 years ago
|
||
mozreview-review |
Comment on attachment 8876791 [details]
Bug 1362787 - Implement chrome.privacy.websites.referrersEnabled,
https://reviewboard.mozilla.org/r/148114/#review152940
::: toolkit/components/extensions/ext-privacy.js:125
(Diff revisions 1 - 2)
> "network.http.sendRefererHeader",
> ],
>
> - // When this setting is true, the pref should be set to 2, and when
> - // this setting is false, the pref should be set to 0.
> + // Values for network.http.sendRefererHeader:
> + // 0=don't send any, 1=send only on clicks, 2=send on image requests as well
> + // http://searchfox.org/mozilla-central/source/modules/libpref/init/all.js#1585
Please make this a permalink
::: toolkit/components/extensions/test/xpcshell/test_ext_privacy.js:281
(Diff revisions 1 - 2)
> - for (let pref in SETTINGS[setting]) {
> - let prefValue = Preferences.get(pref);
> + for (let pref in expected) {
> + equal(Preferences.get(pref), expected[pref], `${pref} set correctly for ${value}`);
> - checkFn(value, pref, prefValue, checkArgs);
> }
nit: can you just use `Assert.deepEqual()` here?
Attachment #8876791 -
Flags: review?(aswan) → review+
Comment hidden (mozreview-request) |
Pushed by bsilverberg@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6787902423dc
Implement chrome.privacy.websites.referrersEnabled, r=aswan
Comment 8•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox56:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Assignee | ||
Updated•8 years ago
|
Keywords: dev-doc-needed
Comment 9•7 years ago
|
||
I've updated the compat data for this:
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/privacy/websites
Marking as dev-doc-complete, but please let me know if we need anything else here.
Keywords: dev-doc-needed → dev-doc-complete
Updated•7 years ago
|
Product: Toolkit → WebExtensions
You need to log in
before you can comment on or make changes to this bug.
Description
•