remove the unnecessary change
This commit is contained in:
parent
fee10fa106
commit
233a000b83
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user