Support ftp urls

This commit is contained in:
tophf 2015-08-06 13:05:36 +03:00
parent 7f0557df57
commit 73218c399b
3 changed files with 3 additions and 3 deletions

View File

@ -221,7 +221,7 @@ function getApplicableSections(style, url) {
function sectionAppliesToUrl(section, url) {
// only http, https, file, and chrome-extension allowed
if (url.indexOf("http") != 0 && url.indexOf("file") != 0 && url.indexOf("chrome-extension") != 0) {
if (url.indexOf("http") != 0 && url.indexOf("file") != 0 && url.indexOf("chrome-extension") != 0 && url.indexOf("ftp") != 0) {
return false;
}
if (!section.urls && !section.domains && !section.urlPrefixes && !section.regexps) {

View File

@ -29,7 +29,7 @@
},
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*", "file:///*"],
"matches": ["<all_urls>"],
"run_at": "document_start",
"all_frames": true,
"js": ["apply.js"]

View File

@ -10,7 +10,7 @@ if (!prefs.getPref("popup.stylesFirst")) {
getActiveTabRealURL(updatePopUp);
function updatePopUp(url) {
var urlWillWork = /^(file|http|https|chrome\-extension):/.exec(url);
var urlWillWork = /^(file|http|https|ftps?|chrome\-extension):/.exec(url);
if (!urlWillWork) {
document.body.classList.add("blocked");
document.getElementById("unavailable").style.display = "block";