Microsoft has acquired GitHub. Decentraleyes has left GitHub. Welcome to its new home!

To participate, please register, or sign in with an existing GitLab.com, Bitbucket, or GitHub account.

Past contributions on GitHub? Be sure to reclaim your Comments, Issues, and Pull Requests.

Verified Commit 5afc4f88 authored by Thomas Rientjes's avatar Thomas Rientjes
Browse files

Update and refactor existing codebase

parent 691affc4
......@@ -55,6 +55,7 @@ interceptor.handleRequest = function (requestDetails, tabIdentifier, tab) {
'blog.datawrapper.de': true,
'bundleofholding.com': true,
'cdnjs.com': true,
'code.world': true,
'dropbox.com': true,
'evoice.com': true,
'freebusy.io': true,
......
......@@ -184,6 +184,29 @@ var mappings = {
}
},
// Baidu CDN
'apps.bdimg.com': {
'/libs/': {
'angular.js/{version}/angular.': resources.angular,
'backbone.js/{version}/backbone.': resources.backbone,
'backbone.js/{version}/backbone-min.': resources.backbone,
'dojo/{version}/dojo.': resources.dojo,
'ember.js/{version}/ember.': resources.ember,
'ext-core/{version}/ext-core.': resources.extCore,
'jquery/{version}/jquery.': resources.jQuery,
'jqueryui/{version}/jquery-ui.js': resources.jQueryUI,
'jqueryui/{version}/jquery-ui.min.js': resources.jQueryUI,
'mootools/{version}/mootools-yui-compressed.': resources.mootools,
'prototype/{version}/prototype.': resources.prototypeJS,
'scriptaculous/{version}/scriptaculous.': resources.scriptaculous,
'swfobject/{version}/swfobject.': resources.swfobject,
'swfobject/{version}/swfobject_src.': resources.swfobject,
'underscore.js/{version}/underscore.': resources.underscore,
'underscore.js/{version}/underscore-min.': resources.underscore,
'webfont/{version}/webfont.': resources.webfont,
'webfont/{version}/webfont_debug.': resources.webfont
}
},
// Baidu CDN [Deprecated]
'libs.baidu.com': {
'/': {
'backbone/{version}/backbone.': resources.backbone,
......
......@@ -125,7 +125,7 @@ stateManager._updateTab = function (details) {
let tabDomain, domainIsWhitelisted, frameIdentifier, tabIdentifier;
tabDomain = helpers.extractDomainFromUrl(details.url);
tabDomain = helpers.extractDomainFromUrl(details.url, true);
domainIsWhitelisted = stateManager._domainIsWhitelisted(tabDomain);
frameIdentifier = details.frameId;
......
......@@ -160,8 +160,10 @@ helpers.determineCdnName = function (domainName) {
return 'Yandex CDN';
case 'yandex.st':
return 'Yandex CDN [Deprecated]';
case 'libs.baidu.com':
case 'apps.bdimg.com':
return 'Baidu CDN';
case 'libs.baidu.com':
return 'Baidu CDN [Deprecated]';
case 'lib.sinaapp.com':
return 'Sina Public Resources';
case 'upcdn.b0.upaiyun.com':
......
......@@ -12,6 +12,8 @@ body {
}
.option {
display: flex;
flex-direction: column;
margin-top: 25px;
}
......@@ -81,6 +83,7 @@ body {
.input-text {
margin-left: 29px;
max-width: 320px;
}
/**
......
......@@ -171,11 +171,7 @@ popup._determineTargetTab = function () {
chrome.tabs.query({'active': true, 'currentWindow': true}, function (tabs) {
popup._targetTab = tabs[0];
popup._domain = helpers.extractDomainFromUrl(tabs[0].url);
if (popup._domain !== null) {
popup._domain = helpers.normalizeDomain(popup._domain);
}
popup._domain = helpers.extractDomainFromUrl(tabs[0].url, true);
resolve();
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment