-
-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #449 from laniakea64/master
privacy.resistFingerprinting.block_mozAddonManager
- Loading branch information
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
browser/components/resistfingerprinting/test/browser/browser_block_mozAddonManager.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* Bug 1384330 - A test case for making sure the navigator.mozAddonManager will | ||
* be blocked when pref 'privacy.resistFingerprinting.block_mozAddonManager' is true. | ||
*/ | ||
|
||
const TEST_PATH = "https://example.com/browser/browser/" + | ||
"components/resistfingerprinting/test/browser/" | ||
|
||
add_task(async function test() { | ||
await SpecialPowers.pushPrefEnv({"set": | ||
[["extensions.webapi.testing", true]] | ||
}); | ||
|
||
for (let pref of [false, true]) { | ||
await SpecialPowers.pushPrefEnv({"set": | ||
[["privacy.resistFingerprinting.block_mozAddonManager", pref]] | ||
}); | ||
|
||
let tab = await BrowserTestUtils.openNewForegroundTab( | ||
gBrowser, TEST_PATH + "file_dummy.html"); | ||
|
||
await ContentTask.spawn(tab.linkedBrowser, pref, function(aPref) { | ||
if (aPref) { | ||
is(content.navigator.mozAddonManager, undefined, | ||
"The navigator.mozAddonManager should not exist when the pref is on."); | ||
} else { | ||
ok(content.navigator.mozAddonManager, | ||
"The navigator.mozAddonManager should exist when the pref is off."); | ||
} | ||
}); | ||
|
||
await BrowserTestUtils.removeTab(tab); | ||
await SpecialPowers.popPrefEnv(); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters