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

Commit

Permalink
https://github.com/NanoAdblocker/NanoCore/issues/40
Browse files Browse the repository at this point in the history
  • Loading branch information
jspenguin2017 committed Dec 15, 2017
1 parent e521a08 commit 2ac1028
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 14 deletions.
3 changes: 1 addition & 2 deletions platform/chromium/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@

"author": "All Nano Adblocker and uBlock Origin contributors",
"background": {
"page": "background.html",
"persistent": true
"page": "background.html"
},
"content_scripts": [
{
Expand Down
12 changes: 0 additions & 12 deletions platform/chromium/vapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,3 @@ if (
}

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

// Patch 2017-12-14: See how compatible Edge is
if (
navigator.userAgent.includes('Edge') &&
typeof browser === 'object' &&
typeof edge === 'undefined'
) {
window.edge = chrome;
chrome = browser;
}

/******************************************************************************/
73 changes: 73 additions & 0 deletions platform/edge/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"manifest_version": 2,

"name": "Nano Adblocker",
"version": "1.0.0.13",

"commands": {
"launch-element-zapper": {
"description": "__MSG_popupTipZapper__"
},
"launch-element-picker": {
"description": "__MSG_popupTipPicker__"
},
"launch-logger": {
"description": "__MSG_popupTipLog__"
}
},
"default_locale": "en",
"description": "Just another adblocker",
"icons": {
"128": "img/128_on.png"
},

"browser_action": {
"default_icon": {
"128": "img/browsericons/128_on.png"
},
"default_title": "Nano Adblocker",
"default_popup": "popup.html"
},

"author": "All Nano Adblocker and uBlock Origin contributors",
"background": {
"page": "background.html",
"persistent": true
},
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"js": ["/js/vapi.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_chrome_version": "45.0",
"optional_permissions": ["file:///*"],
"options_page": "dashboard.html",
"options_ui": {
"page": "options_ui.html"
},
"permissions": [
"contextMenus",
"privacy",
"storage",
"tabs",
"unlimitedStorage",
"webNavigation",
"webRequest",
"webRequestBlocking",
"<all_urls>"
],
"short_name": "Nano",
"storage": {
"managed_schema": "managed_storage.json"
}
}
62 changes: 62 additions & 0 deletions platform/edge/vapi.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*******************************************************************************
uBlock Origin - a browser extension to block requests.
Copyright (C) 2017 The uBlock Origin 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
*/

'use strict';

/* global HTMLDocument, XMLDocument */

// For background page, auxiliary pages, and content scripts.

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

// https://bugzilla.mozilla.org/show_bug.cgi?id=1408996#c9
var vAPI = window.vAPI; // jshint ignore:line

// https://github.com/chrisaljoudi/uBlock/issues/464
// https://github.com/chrisaljoudi/uBlock/issues/1528
// A XMLDocument can be a valid HTML document.

// https://github.com/gorhill/uBlock/issues/1124
// Looks like `contentType` is on track to be standardized:
// https://dom.spec.whatwg.org/#concept-document-content-type

// https://forums.lanik.us/viewtopic.php?f=64&t=31522
// Skip text/plain documents.

if (
(document instanceof HTMLDocument ||
document instanceof XMLDocument &&
document.createElement('div') instanceof HTMLDivElement
) &&
(/^image\/|^text\/plain/.test(document.contentType || '') === false)
) {
vAPI = window.vAPI = vAPI instanceof Object && vAPI.uBO === true
? vAPI
: { uBO: true };
}

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

// Patch 2017-12-14: See how compatible Edge is
window.edge = chrome || {};
window.chrome = browser;

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

0 comments on commit 2ac1028

Please sign in to comment.