remove the unnecessary change

This commit is contained in:
tophf 2021-04-08 09:09:05 +03:00 committed by GitHub
parent fee10fa106
commit 233a000b83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,11 +5,11 @@ if (typeof window.oldCode !== 'string') {
window.oldCode = (document.querySelector('body > pre') || document.body).textContent;
chrome.runtime.onConnect.addListener(port => {
if (port.name !== 'downloadSelf') return;
port.onMessage.addListener(async ({id, force, timer}) => {
port.onMessage.addListener(async ({id, force}) => {
const msg = {id};
try {
const code = await (await fetch(location.href, {mode: 'same-origin'})).text();
if ((code !== window.oldCode || force) || !(timer && code === window.oldCode)) {
if (code !== window.oldCode || force) {
msg.code = window.oldCode = code;
}
} catch (error) {