1
0
Fork 0
mirror of https://github.com/gorhill/uMatrix.git synced 2024-06-28 11:00:38 +12:00

Site-patching possibility for Safari

Safari's extension API doesn't provide a way to intercept requests
initiated by plugins, so those cases need special care (or at least the
popular sites).

This commit adds a new JS file (sitepatch-safari.js), which will store the
patches (if it's possible to create one) for specific sites.

As an example, this commit includes a technique for removing in-video ads
from YouTube videos.
This commit is contained in:
Deathamns 2014-11-02 17:20:06 +01:00 committed by gorhill
parent 686403af38
commit 9f23b45651

View file

@ -3,7 +3,7 @@
(function() {
'use strict';
window.vAPI = window.vAPI || {};
self.vAPI = self.vAPI || {};
// http://www.w3.org/International/questions/qa-scripts#directions
var setScriptDirection = function(langugae) {
@ -38,8 +38,8 @@ vAPI.download = function(details) {
}
};
if (window.chrome) {
var chrome = window.chrome;
if (self.chrome) {
var chrome = self.chrome;
vAPI.getURL = function(path) {
return chrome.runtime.getURL(path);
@ -50,7 +50,7 @@ if (window.chrome) {
};
setScriptDirection(vAPI.i18n('@@ui_locale'));
} else if (window.safari) {
} else if (self.safari) {
vAPI.getURL = function(path) {
return safari.extension.baseURI + path;
};