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

Redirection Notification in WE #863

Open
myrdd opened this issue Nov 3, 2017 · 3 comments
Open

Redirection Notification in WE #863

myrdd opened this issue Nov 3, 2017 · 3 comments

Comments

@myrdd
Copy link
Member

myrdd commented Nov 3, 2017

The redirection notification currently looks like this:

redirection notification screenshot

In the WebExtension (WE) environment, there's no such notification bar, so I'd suggest to use a page action to implement the same feature in the WE version.

@myrdd
Copy link
Member Author

myrdd commented Nov 3, 2017

The notification should be implemented as a "view" module having a single function called show():

export const RedirectionNotification = {
  show(aTabId, aWindowId, aSource, aTarget, aEvents) {
  },
};
  • aTabId / aWindowId: the tab and content window the notification corresponds to
  • aSource / aTarget: source/target URIs
  • aEvents: see below
const events = {
  onAllow({tabId, windowId, source, target}) {},
  onDeny({tabId, windowId, source, target}) {},
  onRuleAdded({tabId, windowId, source, target, ruleSpec}) {},
};

The current implementation (locally on my PC) is available here: https://pastebin.mozilla.org/9071955
Some code (e.g. cropUri() or the loop header (line 70–74)) can be reused from there.

@myrdd
Copy link
Member Author

myrdd commented Nov 16, 2017

I'd suggest to use a page action

Another option is to create a website overlay. However, I do not know if DOM changes by the extension can be detected by the website; but maybe that's not a matter we should care about.

@myrdd
Copy link
Member Author

myrdd commented Nov 25, 2017

@LiamZ are you working on this issue? If not, @jrrdev would take it.

Another option is to create a website overlay. However, I do not know if DOM changes by the extension can be detected by the website; but maybe that's not a matter we should care about.

@jrrdev do you have experience in making such an overlay? In any case, I think a page action is the easiest way to (at least quickly-and-dirtily) port the notification to WE, no? :)

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

No branches or pull requests

1 participant