简体   繁体   中英

How to run tampermonkey in a view-source: page

Background

So I have a javascript that reloads a page every 3 seconds to check if anything new has changed.

Problem

My computer starts to get quite hot.

Question

Is there a way to run tampermonkey or greasemonkey user scripts in a view-source:example.com I've been looking around but can't seem to find much useful info. I also thought of not using javascript maybe use python (the only other language I know) but the site requires a login, so i'm at a loss. I don't want to get too off topic though.

Thanks in advance!

The short answer is: Both GM & TM don't run userscripts on pseudo pages like view-source: and about: .

As workaround you could run a local webserver and write a tiny web proxy script, that serves the page eg inside a <textarea> or a JavaScript string, where JavaScript is the better idea since you can escape string delimiters that are automatically stripped out (the escape characters) when you read the string. If your aims can be reached without displaying in a browser, you could use any programming language able do http requests, eg V8/node-js.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM