Is there a way to block javascript using javascript?
NickName:user5074736 Ask DateTime:2019-11-23T07:04:26

Is there a way to block javascript using javascript?

I'm trying to make an extension for Safari that lets users block javascript per-site, using the new API. The API lets you inject a javascript file that will be loaded onto websites before any of the content, with not much functionality than regular javascript as if it was running on an HTML page. Is there a way to block all javascript using javascript?

The API tells me, vaguely, that "The injected scripts are executed before the webpage has been fully loaded, so you can take action as resources are added to the webpage." Is there some event I can hook into to catch resources being loaded, and block them?

Copyright Notice:Content Author:「user5074736」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/59002903/is-there-a-way-to-block-javascript-using-javascript

More about “Is there a way to block javascript using javascript?” related questions

Is there a way to block javascript using javascript?

I'm trying to make an extension for Safari that lets users block javascript per-site, using the new API. The API lets you inject a javascript file that will be loaded onto websites before any of the

Show Detail

how to block proxy traffic using javascript

Is there any way to block all proxy traffic using javascript, i've already found some using php but i really need it as javascript since i need to use it in a preset iframe that only accepts javasc...

Show Detail

Sonata Block - add javascript block

Is it possible to add a javascript block in a Sonata Block View like this ? {% extends sonata_block.templates.block_base %} {% block block %} <!-- html --> {% endblock %} {% block

Show Detail

Using Javascript to control an HTML block

I have an HTML block on my web page. I want to be able to toggle it on and off based on a Javascript variable. I've tried adding the string of HTML in the Javascript code (HTML inner), but it's a...

Show Detail

Can Slim interpret a block as Javascript?

Is it possible to define a custom helper method that outputs a <script> tag and interprets the captured block as Javascript? Say I want to wrap my Javascript in an IIFE. I'd like to be able to

Show Detail

Extract all documentation block comments from javascript file

I am looking for a reliable, trusty way to extract all block comments from a javascript file that have loaded into memory as a string. I see a ton of options online for using regular expressions, ...

Show Detail

Is there a way to create a VPN with javascript?

I'm trying to create a VPN using javascript, HTML, and CSS. I'm currently just using an iframe, but it only gets around wifi proxies, and then some websites will refuse to connect with X-Frame-Opti...

Show Detail

InsertAfter long block of HTML using Javascript

I'm attempting to insert a long block of HTML after a div element using javascript. I've tried a few methods, but none seem to work. This is what I have now. How do you insert a long block of HTML ...

Show Detail

How to block all client cookies with javascript?

Is there a way to block all cookies sent to client from a webpage using javascript? Is should not allow third-party cookies from iframes or other scripts as well. I've thought about it, like a lis...

Show Detail

Elucidate an obfuscated javascript code block

Is there a way to elucidate an obfuscated javascript code block???

Show Detail