EFForg / https-everywhere Public
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
Embedded WebExtension #11760
Embedded WebExtension #11760
Conversation
extension.getBackgroundPage(), see https://bugzilla.mozilla.org/show_bug.cgi?id=1329304 Instead, we're using runtime.sendMessage() to pass messages between the popup and background page.
required due to use of async functions.
|
In order to maximize the window of time users are given to restart their browsers and have their settings migrated (#11639 (comment)) I'd like to merge this in as soon as possible, and issue a release of the Embedded WebExtension early next week. |
|
@Hainish I hope you didn't sacrifice testing to make this come out earlier? |
|
@koops76 I've been testing all along, but there are bound to be edge cases. Any beta-testers that that want to install this are welcome to, but this combines the work over many months of enumerating bugs in the Firefox WebExtension code and pushing out fixes. What's new in this PR is the migration code as well as the XPCOM wrapper. |
|
If you're referring to the testing framework, we have been using the addon-sdk[1] to install a separate extension to test functionality in Firefox. The Jetpack SDK addons will be deprecated just as XPCOM will, so we can no longer use this. I've changed the Firefox tests to use Selenium just as the Chrome tests do. This means we're confined to the bounds of the Selenium API, and currently our coverage is limited. Building this out is a future task.
…On August 8, 2017 5:37:58 PM PDT, koops76 ***@***.***> wrote:
@Hainish I hope you didn't sacrifice testing to make this come out
earlier?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#11760 (comment)
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
These should be in a separate PR. |
This should also be a separate PR. |
|
@Hainish, I'm sorry, I'm not sure how to test this. I checked out to your branch and ran What am I doing wrong? |
|
@Bisaloo Probably a signature issue. |
|
@Bisaloo You can disable the signature checking by toggling |
You should use an old Nightly Build for this, because they are already removing XPCOM support from current Nightlies (57.0a1). |
|
|
||
| // Send a message to the embedded webextension bootstrap.js to get settings to import | ||
| chrome.runtime.sendMessage("import-legacy-data", function(settings){ | ||
| import_settings(settings); |
You can just provide import_settings directly as the callback parameter to sendMessage, right?
| }); | ||
|
|
||
| /** | ||
| * Enable switch planner for specific tab |
| for(let ruleset of settings.custom_rulesets){ | ||
| all_rules.addFromXml((new DOMParser()).parseFromString(ruleset, 'text/xml')); | ||
| } | ||
| storage.set({"legacy_custom_rulesets": settings.custom_rulesets}, item => { |
Similarly, no need to define a closure here, just pass resolve as the callback.
Why store this under "legacy_custom_rulesets" rather than store the rulesets in the same way as the other custom rulesets? That way we could just call the appropriate function to load all custom rulesets when we're done, eliminating a possible edge case.
@jsha the other custom rulesets are specially formatted objects that do not allow specifying, for instance, exclusions. Here is one example:
[{"host":"example.com","redirectTo":"https://example.com/","urlMatcher":"^http://example\\.com/"}]This was never in XML format, since it is added via the WebExtensions UI. From that format, a RuleSet object is created. This format, notably, does not in its current form support exclusions & securecookies. We'd have to build support for that, as well as code that converts XML to the custom_rule format. I'm not against doing this, but it seems like the job for a future migration.
|
@J0WI Move to "Done" please. |
|
This PR wasn't merged so I'll just remove it from the board |
This PR, superseding #11639 and resolving #10007, migrates settings from the legacy XPCOM codebase to a new, Embedded WebExtensions codebase. This includes:
HTTPSEverywhereCustomUserRulesIn addition, this includes various fixes to the functionality of the WebExtensions code to make it work gracefully in Firefox, cherry-picked from the
webextensionsbranch.Embedded webextensions will be deprecated as of Firefox 57 as well, so this is merely an intermediate step to enable us to have users' settings migrated.
Additionally, this includes a new options ui to allow users to import a json file with settings. Since this replaces #11639, there will be no way for users to export previous settings yet. This won't be a problem, since Embedded WebExtensions are able to transfer settings automatically via the
runtime.sendMessageAPI.The text was updated successfully, but these errors were encountered: