Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Firefox webextensions core - #11791

Merged
Hainish merged 7 commits into
masterfrom
firefox-webextensions-core
Aug 10, 2017
Merged

Hainish merged 7 commits into
masterfrom
firefox-webextensions-core

Conversation

@Hainish

@Hainish Hainish commented Aug 9, 2017

Copy link
Copy Markdown
Member

Core changes to WebExtension code to make it work with Firefox. Reference the done column of https://github.com/EFForg/https-everywhere/projects/1

@Hainish

Hainish commented Aug 10, 2017

Copy link
Copy Markdown
Member Author

@jsha: reverted 7dbab77

@Hainish

Hainish commented Aug 10, 2017

Copy link
Copy Markdown
Member Author

(As with #11792, just let me know when this looks good but don't merge. I'll rebase to remove the original commit as well as the revert).

@jsha jsha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, modulo checking the security question below. Assuming that's resolved, feel free to merge.

Comment thread chromium/popup.js Outdated
label.appendChild(favicon);
} catch (e) {}
if (favicon.src == "chrome://favicon/") {
favicon.src += "https://" + hostnames[ruleset.name];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Talked in person; these lines don't work, let's remove them.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@Hainish @jsha WTF was this XMLHTTPRequest stuff?

Comment thread chromium/background.js

// This is necessary for communication with the popup in Firefox Private
// Browsing Mode, see https://bugzilla.mozilla.org/show_bug.cgi?id=1329304
chrome.runtime.onMessage.addListener(function(message, sender, sendResponse){

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you confirm that this will only receive messages from background.js, not from content scripts or other extensions?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's right. There is a separate IPC API for inter-extension, chrome.runtime.onMessageExternal. See https://developer.chrome.com/extensions/messaging#external

Comment thread chromium/popup.js
if (navigator.userAgent.match("Chrome")) {
var xhr = new XMLHttpRequest();
try {
xhr.open("GET", favicon.src, true);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remove this XMLHTTPRequest stuff. I'm not sure what it was supposed to do at all.

Comment thread chromium/storage.js
@@ -1,6 +1,10 @@
var storage = chrome.storage.local;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This entire file can be deleted and replaced with simple line in each file storage is used.

const storage = chrome.storage.sync || chrome.storage.local

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Within for example the tor browser, chrome.storage.sync may exist but throw an error. That's the reason for the lastError check.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

File a bug for Tor Browser then.

@Hainish
Hainish force-pushed the firefox-webextensions-core branch from 957b3ce to 0d1954a Compare August 10, 2017 01:43
@Hainish
Hainish merged commit 2403b19 into master Aug 10, 2017
@Hainish
Hainish deleted the firefox-webextensions-core branch October 3, 2017 21:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants