Most modern websites use JavaScript to create an interactive website experience. However, this JavaScript can be misused by hackers to inject hacking scripts.
Hence, the Chrome browser has the feature to allow or disallow the JavaScript execution for all the websites or customize it further to selected sites.
In this guide, I have shared the video tutorial and written instructions about:
Watch the Video Guide
Find the video guide helpful? Please consider subscribing to our YouTube channel for more such videos.
Block JavaScript for Sites
Chrome browser has JavaScript enabled by default, but you can disable it from the settings page. Just turn off the JavaScript toggle to disable and block the execution of JavaScript. Here are the steps to follow:
- Launch the Chrome browser on the Computer.
- Click on the More menu and select Settings from the menu list.
- Scroll down to the Privacy and Security section and select the Site settings from the menu.
- Choose the JavaScript option within Site settings.
- Click on the toggle to Block the JavaScript.
It will completely block JavaScript for all the websites. If you want to block JavaScript for any particular website or list of websites, you can add them under the Block section.
All websites listed in the Block section will automatically be blocked from running the JavaScript code.
Allow the JavaScript Execution
If you have already blocked the JavaScript and the website is not loading correctly, then problem may be with JS settings. In that case, you should allow the execution. Here are the steps to follow:
- Launch Google Chrome on your computer.
- Click on the More menu list and select Settings menu.
- Scroll down to the Privacy and Security section, and select the Site settings from the menu.
- Choose the JavaScript option within Site settings.
- Click on the toggle button to Allow the JavaScript.
It will allow all the websites to run the JavaScript code on the browser and execute the function within the code block. However, if you want to allow JavaScript execution on a few websites, you can find all the URLs in the Allow section.
The website in the allow section will run the JavaScript code irrespective of the main switch.
Bottom Line
We can easily block the JavaScript on selected sites or allow the execution in the Chrome browser.
If you block the JavaScript execution, the website might not run as expected. Perhaps, you should block only the untrusted sites that you are willing to visit.
Similarly, you can allow or block JavaScript in Chrome browser on Android. You allow selected sites to enable JavaScript or block them by adding them to the Block bucket.
Lastly, if you've any thoughts or feedback, then feel free to drop in below comment box. You can also report the outdated information.
I apologize for any mistakes I may have made
Pretty easy directions to follow