From 72167254a897e3b4728a502d083b98529410ab7f Mon Sep 17 00:00:00 2001 From: eight Date: Mon, 10 Dec 2018 22:04:51 +0800 Subject: [PATCH] Fix: remove unused code --- content/install-hook-userstyles.js | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/content/install-hook-userstyles.js b/content/install-hook-userstyles.js index 24745d6c..2717abb4 100644 --- a/content/install-hook-userstyles.js +++ b/content/install-hook-userstyles.js @@ -364,29 +364,6 @@ document.documentElement.appendChild(document.createElement('script')).text = '( }; } - // spoof USO referrer for style search in the popup - if (window !== top && location.pathname === '/') { - window.addEventListener('message', ({data, origin}) => { - if (!data || - !data.xhr || - origin !== EXTENSION_ORIGIN) { - return; - } - const xhr = new XMLHttpRequest(); - xhr.onloadend = xhr.onerror = () => { - top.postMessage({ - id: data.xhr.id, - status: xhr.status, - // [being overcautious] a string response is used instead of relying on responseType=json - // because it was invoked in a web page context so another extension may have incorrectly spoofed it - response: xhr.response, - }, EXTENSION_ORIGIN); - }; - xhr.open('GET', data.xhr.url); - xhr.send(); - }); - } - // USO bug workaround: use the actual style settings in API response let settings; const originalResponseJson = Response.prototype.json;