Skip to content

Allow enabling "Block Scripts" without reloading the page #46291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 of 6 tasks
ell1e opened this issue May 23, 2025 · 3 comments
Open
2 of 6 tasks

Allow enabling "Block Scripts" without reloading the page #46291

ell1e opened this issue May 23, 2025 · 3 comments
Labels
enhancement feature/shields/!scripts Blocking JavaScript with Shields feature/shields The overall Shields feature in Brave. OS/Desktop priority/P4 Planned work. We expect to get to it "soon". privacy

Comments

@ell1e
Copy link

ell1e commented May 23, 2025

Description

Perhaps it's just me, but for various reasons it seems like a bad idea to reload the page when "Block Scripts" is toggled from "off" (scripts running) to "on" (scripts stopped). The by far most common reason to toggle this is:

  1. a script is malfunctioning, or

  2. a script is intentionally doing something harmful or anti-user.

In both cases, I don't see how what the user wants is for everything to be ripped away, reloaded, now possibly even more broken. At best, it wastes time, at worst, now what the user actually wanted to look at with just scripts disabled isn't even loading properly anymore. So that seems like a nonsensical action to me, and I suggest it is removed.

The reverse, reloading the page when toggling scripts from off to on, seems meaningful since I guess otherwise the scripts won't start from a meaningful clean slate. But that seems like a separate, unrelated action.

Steps to reproduce

  1. Go on a page that e.g. does a popup that bypasses the adblocker
  2. Close the popup and toggle "Block scripts" so it can't reappear
  3. The whole tab reloads which may completely break everything, and does nothing for what you actually wanted to do (which is simply from preventing any more javascript to run that might modify the current state of the tab)

Actual result

When I disable javascript to stop it from modifying the page, the page is reloaded which seems like the most modified it could be

Expected result

When I stop JavaScript, the page just stays as-is

Reproduces how often

Easily reproduced

Brave version (brave://version info)

Brave 1.78.102 Chromium: 136.0.7103.113 (Official Build) unknown (64-bit)

Channel information

  • release (stable)
  • beta
  • nightly

Reproducibility

  • with Brave Shields disabled
  • with Brave Rewards disabled
  • in the latest version of Chrome

Miscellaneous information

No response

@ShivanKaul
Copy link
Collaborator

All Shields toggles reload the page because in practice we found that not reloading the page after making a change resulted in unexpected website behavior, the setting not actually being applied and the user getting confused. Also, they're content settings, and content settings need reloads in order to apply correctly.

In your steps to reproduce, you say:

The whole tab reloads which may completely break everything, and does nothing for what you actually wanted to do (which is simply from preventing any more javascript to run that might modify the current state of the tab)

I'm not following what you mean by "completely break everything". Can you give a concrete example on a website?

@ShivanKaul ShivanKaul added enhancement feature/shields The overall Shields feature in Brave. needs-more-info The report requires more detail before we can decide what to do with this issue. feature/shields/!scripts Blocking JavaScript with Shields labels May 23, 2025
@ell1e
Copy link
Author

ell1e commented May 23, 2025

The one website I used loaded content with JavaScript, but then kept loading popups with JavaScript. If you reload it without JavaScript, the entire content area is missing. If you would disable the JavaScript in the middle of it after closing a popup, it would just stop pestering you (in theory, since the reload in practice prevented me from making that a reality).

Another example might be cookie banner popups, paywalls, and so on. In many of those cases you may want the page to load with full JavaScript until a certain point, then hit stop on all the JavaScript once it's the right amount of partially loaded.

@ShivanKaul
Copy link
Collaborator

The one website I used loaded content with JavaScript, but then kept loading popups with JavaScript. If you reload it without JavaScript, the entire content area is missing. If you would disable the JavaScript in the middle of it after closing a popup, it would just stop pestering you

I see, that's helpful.

@ShivanKaul ShivanKaul changed the title It seems like a bad idea to reload the page when "Block Scripts" is toggled from "off" (scripts running) to "on" (scripts stopped) Allow enabling "Block Scripts" without reloading the page May 23, 2025
@ShivanKaul ShivanKaul added privacy priority/P4 Planned work. We expect to get to it "soon". and removed needs-more-info The report requires more detail before we can decide what to do with this issue. labels May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature/shields/!scripts Blocking JavaScript with Shields feature/shields The overall Shields feature in Brave. OS/Desktop priority/P4 Planned work. We expect to get to it "soon". privacy
Projects
None yet
Development

No branches or pull requests

2 participants