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

Commit

Permalink
Initial Edge support
Browse files Browse the repository at this point in the history
Not working:
 - Downloads (Edge doesn't allow downloads from background pages)
 - Definition updates (invalid handle error)
  • Loading branch information
nicole-ashley committed Jul 20, 2016
1 parent 41b20ca commit 4de6874
Show file tree
Hide file tree
Showing 15 changed files with 2,056 additions and 0 deletions.
Binary file added platform/edge/img/browsericons/icon19-off.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added platform/edge/img/browsericons/icon19.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added platform/edge/img/browsericons/icon38-off.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added platform/edge/img/browsericons/icon38.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions platform/edge/is-webrtc-supported.html
@@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
<script async src="js/is-webrtc-supported.js"></script>
</head>
<body></body>
</html>
52 changes: 52 additions & 0 deletions platform/edge/is-webrtc-supported.js
@@ -0,0 +1,52 @@
/*******************************************************************************
uBlock Origin - a browser extension to block requests.
Copyright (C) 2015 Raymond Hill
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see {http://www.gnu.org/licenses/}.
Home: https://github.com/gorhill/uBlock
*/

// https://github.com/gorhill/uBlock/issues/533#issuecomment-164292868
// If WebRTC is supported, there won't be an exception if we
// try to instanciate a peer connection object.

// https://github.com/gorhill/uBlock/issues/533#issuecomment-168097594
// Because Chromium leaks WebRTC connections after they have been closed
// and forgotten, we need to test for WebRTC support inside an iframe, this
// way the closed and forgottetn WebRTC connections are properly garbage
// collected.

(function() {
'use strict';

var pc = null;
try {
var PC = self.RTCPeerConnection || self.webkitRTCPeerConnection;
if ( PC ) {
pc = new PC(null);
}
} catch (ex) {
console.error(ex);
}
if ( pc !== null ) {
pc.close();
}

window.top.postMessage(
pc !== null ? 'webRTCSupported' : 'webRTCNotSupported',
window.location.origin
);
})();
11 changes: 11 additions & 0 deletions platform/edge/managed_storage.json
@@ -0,0 +1,11 @@
{
"$schema": "http://json-schema.org/draft-03/schema#",
"type": "object",
"properties": {
"adminSettings": {
"title": "A valid JSON string compliant with uBO's backup format.",
"description": "All entries present will overwrite local settings.",
"type": "string"
}
}
}
64 changes: 64 additions & 0 deletions platform/edge/manifest.json
@@ -0,0 +1,64 @@
{
"manifest_version": 2,

"name": "uBlock Origin",
"version": "1.7.7",

"default_locale": "en",
"description": "__MSG_extShortDesc__",
"icons": {
"16": "img/icon_16.png",
"128": "img/icon_128.png"
},

"browser_action": {
"default_icon": {
"19": "img/browsericons/icon19.png",
"38": "img/browsericons/icon38.png"
},
"default_title": "uBlock Origin",
"default_popup": "popup.html"
},

"author": "All uBlock Origin contributors",
"background": {
"page": "background.html",
"persistent": true
},
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"js": ["js/vapi-client.js", "js/contentscript.js"],
"run_at": "document_start",
"all_frames": true
},
{
"matches": ["http://*/*", "https://*/*"],
"js": ["js/scriptlets/subscriber.js"],
"run_at": "document_idle",
"all_frames": false
}
],
"incognito": "split",
"minimum_edge_version": "38.14393",
"options_page": "dashboard.html",
"options_ui": {
"page": "options_ui.html"
},
"permissions": [
"contextMenus",
"privacy",
"storage",
"tabs",
"unlimitedStorage",
"webNavigation",
"webRequest",
"webRequestBlocking",
"http://*/*",
"https://*/*"
],
"short_name": "uBlock₀",
"storage": {
"managed_schema": "managed_storage.json"
}
}
11 changes: 11 additions & 0 deletions platform/edge/options_ui.html
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<script src="js/vapi-client.js"></script>
<script src="js/options_ui.js"></script>
<title></title>
</head>
<body>
<a href="dashboard.html" target="uBO">Dashboard</a>
</body>
</html>
47 changes: 47 additions & 0 deletions platform/edge/options_ui.js
@@ -0,0 +1,47 @@
/*******************************************************************************
µBlock - a browser extension to block requests.
Copyright (C) 2015 The µBlock authors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see {http://www.gnu.org/licenses/}.
Home: https://github.com/gorhill/uBlock
*/

/******************************************************************************/

(function() {

/******************************************************************************/

'use strict';

vAPI.messaging.send(
'default',
{
what: 'gotoURL',
details: {
url: 'dashboard.html',
select: true,
index: -1
}
}
);
window.close();

/******************************************************************************/

})();

/******************************************************************************/

0 comments on commit 4de6874

Please sign in to comment.