Normalize line endings in apply.js

This commit is contained in:
tophf 2015-05-06 19:53:41 +03:00
parent f62ccbc0ca
commit 2faead9732

View File

@ -1,18 +1,18 @@
requestStyles();
function requestStyles() {
// If this is a Stylish page (Edit Style or Manage Styles),
// we'll request the styles directly to minimize delay and flicker,
// unless Chrome still starts up and the background page isn't fully loaded.
// (Note: in this case the function may be invoked again from applyStyles.)
var request = {method: "getStyles", matchUrl: location.href, enabled: true, asHash: true};
if (location.href.indexOf(chrome.extension.getURL("")) == 0) {
var bg = chrome.extension.getBackgroundPage();
if (bg && bg.getStyles) {
bg.getStyles(request, applyStyles);
return;
}
}
requestStyles();
function requestStyles() {
// If this is a Stylish page (Edit Style or Manage Styles),
// we'll request the styles directly to minimize delay and flicker,
// unless Chrome still starts up and the background page isn't fully loaded.
// (Note: in this case the function may be invoked again from applyStyles.)
var request = {method: "getStyles", matchUrl: location.href, enabled: true, asHash: true};
if (location.href.indexOf(chrome.extension.getURL("")) == 0) {
var bg = chrome.extension.getBackgroundPage();
if (bg && bg.getStyles) {
bg.getStyles(request, applyStyles);
return;
}
}
chrome.extension.sendMessage(request, applyStyles);
}
@ -36,9 +36,9 @@ chrome.extension.onMessage.addListener(function(request, sender, sendResponse) {
case "styleReplaceAll":
replaceAll(request.styles, document);
break;
case "realURL":
sendResponse(location.href);
break;
case "realURL":
sendResponse(location.href);
break;
case "styleDisableAll":
disableAll(request.disableAll);
break;
@ -74,10 +74,10 @@ function removeStyle(id, doc) {
}
function applyStyles(styleHash) {
if (!styleHash) { // Chrome is starting up
requestStyles();
return;
}
if (!styleHash) { // Chrome is starting up
requestStyles();
return;
}
if ("disableAll" in styleHash) {
disableAll(styleHash.disableAll);
delete styleHash.disableAll;
@ -162,4 +162,4 @@ var iframeObserver = new MutationObserver(function(mutations) {
});
});
});
iframeObserver.observe(document, {childList: true, subtree: true});
iframeObserver.observe(document, {childList: true, subtree: true});