Merge pull request #145 from tophf/support-ftp

Support ftp urls
This commit is contained in:
Jason Barnabe 2015-08-12 20:21:02 -05:00
commit 461d52ac41
3 changed files with 3 additions and 3 deletions

View File

@ -221,7 +221,7 @@ function getApplicableSections(style, url) {
function sectionAppliesToUrl(section, url) { function sectionAppliesToUrl(section, url) {
// only http, https, file, and chrome-extension allowed // 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; return false;
} }
if (!section.urls && !section.domains && !section.urlPrefixes && !section.regexps) { if (!section.urls && !section.domains && !section.urlPrefixes && !section.regexps) {

View File

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

View File

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