Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

privacy.resistFingerprinting.block_mozAddonManager #449

Merged
merged 2 commits into from
Mar 5, 2018
Merged

privacy.resistFingerprinting.block_mozAddonManager #449

merged 2 commits into from
Mar 5, 2018

Conversation

laniakea64
Copy link

Fixes #441

….resistFingerprinting.block_mozAddonManager' is true. r=arthuredelstein,mossop

This patch adds a hidden pref 'privacy.resistFingerprinting.block_mozAddonManager',
which is false by default. When this is true, the navigator.mozAddonManager will
be blocked even the website is AMO.

The purpose of this pref is for Tor browser can disable navigator.mozAddonManager
through this.

MozReview-Commit-ID: Lf37gHXETCz
@jbeich
Copy link
Contributor

jbeich commented Feb 23, 2018

If not too hard consider backporting all commits from the specific Mozilla bug. While tests aren't immediately useful they can help troubleshooting cherry-picking mistakes.

…ddonManager is correctly blocked when pref 'privacy.resistFingerprinting.block_mozAddonManager' is true. r=arthuredelstein,mossop

The patch adds a test case which will first test with the pref off to see that
navigator.mozAddonManager can be accessed successfully. And then turn the pref
on to see that whether navigator.mozAddonManager is blocked.

MozReview-Commit-ID: 3nptUqdg7p7
@laniakea64
Copy link
Author

@jbeich Done, but it's broken due to testing/marionette/assert.js explicitly requiring Firefox. Changing isFirefox to check for Waterfox gets it to go, but I'm not sure if that's enough to really fix it. I don't know this test stuff well at all 😕

Copy link
Collaborator

@MrAlex94 MrAlex94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should work without a problem.

@MrAlex94
Copy link
Collaborator

@laniakea64, I don't believe I've changed any of the actual internal variables named Firefox, except in relation to the registry and the branding files. Do you receive any errors running marionette tests?

@laniakea64
Copy link
Author

This command...

./mach mochitest -f browser browser/components/resistfingerprinting/test

... just chokes -

Traceback (most recent call last):
  File "/srv/waterfox/Waterfox/objdir/_tests/testing/mochitest/runtests.py", line 2540, in doTests
    marionette_args=marionette_args,
  File "/srv/waterfox/Waterfox/objdir/_tests/testing/mochitest/runtests.py", line 2148, in runApp
    os.path.join(here, 'extensions', 'specialpowers')
  File "/srv/waterfox/Waterfox/testing/marionette/client/marionette_driver/addons.py", line 50, in install
    return self._mn._send_message("addon:install", body, key="value")
  File "/srv/waterfox/Waterfox/testing/marionette/client/marionette_driver/decorators.py", line 23, in _
    return func(*args, **kwargs)
  File "/srv/waterfox/Waterfox/testing/marionette/client/marionette_driver/marionette.py", line 739, in _send_message
    self._handle_error(err)
  File "/srv/waterfox/Waterfox/testing/marionette/client/marionette_driver/marionette.py", line 772, in _handle_error
    raise errors.lookup(error)(message, stacktrace=stacktrace)
UnsupportedOperationException: Only supported in Firefox
stacktrace:
        WebDriverError@chrome://marionette/content/error.js:227:5
        UnsupportedOperationError@chrome://marionette/content/error.js:532:5
        assert.that/<@chrome://marionette/content/assert.js:383:13
        assert.firefox@chrome://marionette/content/assert.js:65:3
        GeckoDriver.prototype.installAddon@chrome://marionette/content/driver.js:3190:3
        execute/req<@chrome://marionette/content/server.js:539:22
        TaskImpl_run@resource://gre/modules/Task.jsm:331:42
        TaskImpl@resource://gre/modules/Task.jsm:280:3
        asyncFunction@resource://gre/modules/Task.jsm:252:14
        Task_spawn@resource://gre/modules/Task.jsm:166:12
        execute@chrome://marionette/content/server.js:529:15
        onPacket@chrome://marionette/content/server.js:500:7
        _onJSONObjectReady/<@chrome://marionette/content/transport.js:501:9

0 ERROR Automation Error: Received unexpected exception while running application

Stopping web server
Stopping web socket server
Stopping ssltunnel
leakcheck | refcount logging is off, so leaks can't be detected!
runtests.py | Running tests: end.
Buffered messages finished
TEST-INFO | checking window state
Browser Chrome Test Summary
        Passed: 0
        Failed: 0
        Todo: 0
        Mode: e10s
*** End BrowserChrome Test Results ***
Buffered messages finished
SUITE-END | took 15s

If https://github.com/MrAlex94/Waterfox/blob/master/testing/marionette/assert.js#L25 is changed to check for Waterfox, the command runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants