From 2faead97320b93f8ccd1b3e1599d5cab2b80b0b7 Mon Sep 17 00:00:00 2001 From: tophf Date: Wed, 6 May 2015 19:53:41 +0300 Subject: [PATCH] Normalize line endings in apply.js --- apply.js | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/apply.js b/apply.js index cc8fc8a0..2d16b379 100644 --- a/apply.js +++ b/apply.js @@ -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}); \ No newline at end of file +iframeObserver.observe(document, {childList: true, subtree: true});