Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

use origin for the notification message and for site settings and cho… #3965

Merged
merged 2 commits into from
Sep 14, 2016

Conversation

bridiver
Copy link
Collaborator

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).

Test Plan:

  1. Go to https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/Using_geolocation
  2. notification should display for https://mdn.mozillademos.org vs page origin of http://developer.mozilla.org
  3. change tabs or open a new tab
  4. notification should not appear
  5. return to the original tab
  6. notification should be displayed

The changes for Brave Browser notifications aren't currently testable because we don't get the mainFrameUrl for notifications yet, but I have tested them with a local hack

don't allow Brave to display notifications without permission
remove unnecessary password copied notifications
cc @bbondy @diracdeltas
fix #3877

…ose tabs to display on based on mainFrameUrl

don't allow Brave to display notifications without permission
remove unnecessary password copied notifications
cc @bbondy @diracdeltas
fix #3877
@bridiver
Copy link
Collaborator Author

fix #3962

@diracdeltas
Copy link
Member

this causes some of the notificationBar tests to fail

@@ -367,7 +374,7 @@ function registerPermissionHandler (session, partition) {
cb(result)
if (persist) {
// remember site setting for this host over http(s)
appActions.changeSiteSetting(getOrigin(url), permission + 'Permission', result, isPrivate)
appActions.changeSiteSetting(origin, permission + 'Permission', result, isPrivate)
Copy link
Member

Choose a reason for hiding this comment

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

need to strip the trailing / from origin for backwards compatibility; i think this is why tests are breaking

Copy link
Member

Choose a reason for hiding this comment

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

hence why getOrigin was necessary before

'Brave Browser' works with getSiteSettingsForHostPattern but not
getSiteSettingsForURL.

Auditors: @bridiver

Test Plan: Covered by automated test
@diracdeltas diracdeltas merged commit 8a43d49 into master Sep 14, 2016
@diracdeltas diracdeltas deleted the permission-fixes branch September 14, 2016 01:49
@luixxiul luixxiul added this to the 0.12.1dev milestone Sep 14, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression : session.setPermissionRequestHandler callback is broken
3 participants