-
Notifications
You must be signed in to change notification settings - Fork 45
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
Port to WebExtension (WIP) #176
Commits on May 1, 2018
-
Basically only whitespace and renaming variables and functions. Should be functionally completely equivalent to previous commit.
Configuration menu - View commit details
-
Copy full SHA for c106258 - Browse repository at this point
Copy the full SHA c106258View commit details -
Change XUL to WebExt: keep the magic, drop the logic
- Add a manifest for webext version and remove install.rdf - Remove files & functions that do setup (bootstrap.js, ...) - Keep functions that do actual cleaning work (browser.js -> cleanlinks.js)
Configuration menu - View commit details
-
Copy full SHA for 4b17f6e - Browse repository at this point
Copy the full SHA 4b17f6eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1522a7f - Browse repository at this point
Copy the full SHA 1522a7fView commit details -
Configuration menu - View commit details
-
Copy full SHA for bf15e40 - Browse repository at this point
Copy the full SHA bf15e40View commit details -
Add content script to re-write URIs in pages/on click
Remove recursive functions, as content scripts are injected in every frame.
Configuration menu - View commit details
-
Copy full SHA for c421bca - Browse repository at this point
Copy the full SHA c421bcaView commit details -
Update count of, and notify about cleaned links
Add messaging between background and content script to send cleaned-click events and numbers of links cleaned. In background.js, update the count (on the badget text), notify the user, and (TODO) track the cleaned links for potential future whitelisting
Configuration menu - View commit details
-
Copy full SHA for 0ca773a - Browse repository at this point
Copy the full SHA 0ca773aView commit details -
Add options page, populate values & i18n strings
Loading options and updating+storing options on change still to be done.
Configuration menu - View commit details
-
Copy full SHA for da86103 - Browse repository at this point
Copy the full SHA da86103View commit details -
Add options saving/loading/modifying
Requires storage permission. Options are stored as they are displayed in the options page, and loaded based on the object types in the default values. All the main code is wrapped in the loadOptions.then() to be sure that we load options from storage before anything else. A message is sent to the background script to trigger a new loadOptions() whenever new values are saved, so that it stays up to date.
Configuration menu - View commit details
-
Copy full SHA for 23abe8c - Browse repository at this point
Copy the full SHA 23abe8cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 201c976 - Browse repository at this point
Copy the full SHA 201c976View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0551c96 - Browse repository at this point
Copy the full SHA 0551c96View commit details -
Configuration menu - View commit details
-
Copy full SHA for 840c5ba - Browse repository at this point
Copy the full SHA 840c5baView commit details -
Configuration menu - View commit details
-
Copy full SHA for 74a6265 - Browse repository at this point
Copy the full SHA 74a6265View commit details
Commits on May 2, 2018
-
Configuration menu - View commit details
-
Copy full SHA for e2fd85f - Browse repository at this point
Copy the full SHA e2fd85fView commit details -
Respect event-mode option: do not always clean whole doc
Also repeat the dirty hack to handle links added in a document with ajax, which consistss of running a clean again after repdelay seconds after a click.
Configuration menu - View commit details
-
Copy full SHA for 843767a - Browse repository at this point
Copy the full SHA 843767aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3b59089 - Browse repository at this point
Copy the full SHA 3b59089View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9f35b4e - Browse repository at this point
Copy the full SHA 9f35b4eView commit details -
Add support for clean-link to clipboard copying
A new contextMenu item is required for this, as we can't intercept the previous one anymore in web extensions. The setup for this feature is a little contrived: - copying to clipboard can not be done from a background script. - on links or selections, the target text (link to be cleaned) is available from the background script where the contextMenu event is handled. - otherwise, only the script in the page knows where the right click that triggered the contextMenu is, thus what the text is. Thus, organise the flow thusly: 1. In injected content script, on right click, send text link around click position to background and wait for (optional) response. 2. In background script, if our contextMenu item is clicked, get sent text link and clean it (or use a.href or selected text), and send cleaned link as message reply 3. In injected content script, if there is a response to the message, copy it to the clipboard. NB. Are we leaving hanging promises around? Or do they get GC'd? NB2. There might be a race condition when accessing lastRightClick, i.e. the saved text link message (content script (1.) -> background (2.)). If clicked too fast, maybe the message didn't arrive yet. To fix that, we probably would need to wrap lastRightClick in another promise.
Configuration menu - View commit details
-
Copy full SHA for b3a5868 - Browse repository at this point
Copy the full SHA b3a5868View commit details
Commits on May 6, 2018
-
Configuration menu - View commit details
-
Copy full SHA for e89cd51 - Browse repository at this point
Copy the full SHA e89cd51View commit details -
Configuration menu - View commit details
-
Copy full SHA for d64d1d4 - Browse repository at this point
Copy the full SHA d64d1d4View commit details -
Configuration menu - View commit details
-
Copy full SHA for da48a19 - Browse repository at this point
Copy the full SHA da48a19View commit details -
Add a preference to know whether we switch to new tabs
There is a browser preference that controls this: "When you open a link in a new tab, switch to it immediately" However this preference is not available through the browserSettings API: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/browserSettings
Configuration menu - View commit details
-
Copy full SHA for bfacefb - Browse repository at this point
Copy the full SHA bfacefbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8159600 - Browse repository at this point
Copy the full SHA 8159600View commit details
Commits on May 13, 2018
-
Configuration menu - View commit details
-
Copy full SHA for d36e3d5 - Browse repository at this point
Copy the full SHA d36e3d5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 689adcd - Browse repository at this point
Copy the full SHA 689adcdView commit details -
Only enable modifying requests when OMR is enabled
Also move the cleaning function to cleanlinks.js. Perform the cleaning in the onRequest function by returning the {redirectUrl: ...} object if we have a cleaned link. Integrate as comments all fixes from the original XUL code in case those bugs show up again.
Configuration menu - View commit details
-
Copy full SHA for 0c16959 - Browse repository at this point
Copy the full SHA 0c16959View commit details -
Configuration menu - View commit details
-
Copy full SHA for dc8f353 - Browse repository at this point
Copy the full SHA dc8f353View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e38a74 - Browse repository at this point
Copy the full SHA 9e38a74View commit details -
Configuration menu - View commit details
-
Copy full SHA for d5379f9 - Browse repository at this point
Copy the full SHA d5379f9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 282fb2f - Browse repository at this point
Copy the full SHA 282fb2fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 098c08e - Browse repository at this point
Copy the full SHA 098c08eView commit details -
Configuration menu - View commit details
-
Copy full SHA for ba0965c - Browse repository at this point
Copy the full SHA ba0965cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 61ee3b5 - Browse repository at this point
Copy the full SHA 61ee3b5View commit details -
Update regex-stripping of javacript: in links
The AMO parser was throwing a syntax error on parsing the previous version for some reason. Logic remains the same: identify a link in a jacascript:... text and keep just that.
Configuration menu - View commit details
-
Copy full SHA for 294fa3e - Browse repository at this point
Copy the full SHA 294fa3eView commit details