Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
283 views
in Technique[技术] by (71.8m points)

Google Chrome extension - how to turn JavaScript on/off?

Is it possible to turn JavaScript on/off with a self-made Google Chrome extension?

For example, in Opera browser, there are simple possibilities to do that with widgets, user-made buttons, etc., but I didn't find any solutions to do that in Chrome (my first source was the official Google Chrome extensions' documentations).

A strange aspect is that I need JavaScript to run the extension itself...if I'm able to turn JavaScript off with an extension, can I still use JavaScript in my extension after doing it?


Edit:

It's already possible to do it via chrome.contentSettings.javascript!
See this example which shows how to use it (Quick JavaScript Switcher extension, which mlb linked here).

question from:https://stackoverflow.com/questions/4663359/google-chrome-extension-how-to-turn-javascript-on-off

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It's now possible with the ContentSettings API,
and there is an extension named Quick Javascript Switcher that turns on/off javascript on the fly : https://github.com/maximelebreton/quick-javascript-switcher

QJS on the Chrome Webstore : https://chrome.google.com/webstore/detail/geddoclleiomckbhadiaipdggiiccfje

Enjoy !

seo : disable javascript chrome extension


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...