Apply styles to Stylish pages
This commit is contained in:
parent
0006e001b4
commit
5e3efb3df6
|
@ -144,8 +144,8 @@ function getApplicableSections(style, url) {
|
|||
}
|
||||
|
||||
function sectionAppliesToUrl(section, url) {
|
||||
// only http, https, and file allowed
|
||||
if (url.indexOf("http") != 0 && url.indexOf("file") != 0) {
|
||||
// only http, https, file, and chrome-extension allowed
|
||||
if (url.indexOf("http") != 0 && url.indexOf("file") != 0 && url.indexOf("chrome-extension") != 0) {
|
||||
return false;
|
||||
}
|
||||
if (!section.urls && !section.domains && !section.urlPrefixes && !section.regexps) {
|
||||
|
|
|
@ -89,6 +89,7 @@
|
|||
<script src="storage.js"></script>
|
||||
<script src="messaging.js"></script>
|
||||
<script src="localization.js"></script>
|
||||
<script src="apply.js"></script>
|
||||
</head>
|
||||
<body id="stylish-edit">
|
||||
<div id="header">
|
||||
|
|
|
@ -88,6 +88,7 @@
|
|||
<script src="health.js"></script>
|
||||
<script src="storage.js"></script>
|
||||
<script src="messaging.js"></script>
|
||||
<script src="apply.js"></script>
|
||||
</head>
|
||||
<body id="stylish-manage">
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
<script src="health.js"></script>
|
||||
<script src="storage.js"></script>
|
||||
<script src="messaging.js"></script>
|
||||
<script src="apply.js"></script>
|
||||
</head>
|
||||
<body id="stylish-popup">
|
||||
|
||||
|
|
2
popup.js
2
popup.js
|
@ -5,7 +5,7 @@ var writeStyleTemplate = document.createElement("a");
|
|||
writeStyleTemplate.className = "write-style-link";
|
||||
|
||||
chrome.tabs.getSelected(null, function(tab) {
|
||||
var urlWillWork = /^(file|http|https):.*/.test(tab.url);
|
||||
var urlWillWork = /^(file|http|https|chrome\-extension):.*/.test(tab.url);
|
||||
|
||||
if (!urlWillWork) {
|
||||
["installed", "find-styles", "write-style"].forEach(function(id) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user