JavaScript rules

Blaz

Moderator & Translator
Staff member
Moderator
Please add the following features:
- Don't allow content menu (right click) on websites to be disabled (e. g. esenyurthaberleri.com)
- Remove music and sounds
- Remove background images
Code:
#$#body, body>div, body>div>div { background-image: none!important; }
- Prevent sites changing scroll bar colors
- Prevent sites bookmarking themselves
- Prevent sites reloading themselves
Code:
#%#window.reload = function() {}
- Prevent sites moving/resizing their window
- Prevent sites changing the active window
- Prevent sites changing bookmark/address icons
- Prevent sites opening new windows (always force to open new tabs instead)
 
Last edited by a moderator:

avatar

Administrator
Staff member
Administrator
@Blaz, I suggest you update the first post when a working solution for any of listed issues is found.

---------- Post added at 12:59 AM ---------- Previous post was at 12:59 AM ----------

- Remove background images
Do you mean "body" background images? Or ANY background images?

---------- Post added at 01:00 AM ---------- Previous post was at 12:59 AM ----------

- Prevent sites changing scroll bar colors
Wait what? Do you have an example of such website?

---------- Post added at 01:01 AM ---------- Previous post was at 01:00 AM ----------

- Prevent sites bookmarking themselves
I need a site example also. As I know it is impossible without explicit user permission.

---------- Post added at 01:05 AM ---------- Previous post was at 01:01 AM ----------

- Prevent sites reloading themselves
Again, I need an example (when such reloading is a problem for user).

Meanwhile, you can try this:
Code:
#%#(function(){var a=window.reload,b=document.location.host;window.reload=function(){confirm("Do you allow site "+b+" reload the page?")&&a()}})();
- Prevent sites moving/resizing their window
- Prevent sites changing the active window
- Prevent sites changing bookmark/address icons
Again, I need examples.

---------- Post added at 01:08 AM ---------- Previous post was at 01:05 AM ----------

-Prevent sites opening new windows (always force to open new tabs instead)
That's possible, but i need a site to test that new rule.

Basically what we need it overriding "window.open" function and changing some of it's parameters.
 

Blaz

Moderator & Translator
Staff member
Moderator
Sure I will update the top post, when a solution is found:
Most of these requests are from Ad Muncher's option list, so it would take a while to find an example.

Body background would be a start.

Site with auto-refresh (about 300 seconds):
Code:
http://www.bostonherald.com/
Code:
http://www.ynet.co.il
http://www.latimes.com/
http://abcnews.go.com/
 
Last edited by a moderator:

avatar

Administrator
Staff member
Administrator
Body background would be a start.
That should do it:
Code:
#$#body { background-image: none!important; }
But sometimes it's not enough (when background is set for some wrapper div).
We may try some more rules to suppress bg image for first 2 levels after body:
Code:
#$#body, body>div, body>div>div { background-image: none!important; }
Site with auto-refresh (about 300 seconds):
Code:
http://www.bostonherald.com/
We could simply suppress all window.reload calls.
But I am not sure if this is good enough.
Code:
#%#window.reload = function() {}
Code:
http://www.ynet.co.il
http://www.latimes.com/
http://abcnews.go.com/
These are also auto-refresh?
 

Blaz

Moderator & Translator
Staff member
Moderator
Yes, also auto-refresh, but don't know the timeout.
 
Last edited by a moderator:

avatar

Administrator
Staff member
Administrator
Yes, also auto-refresh, but don't know the timeout.
What do you think is better: fully suppress refresh or show confirmation dialog when the website tries to reload the page?
 

Blaz

Moderator & Translator
Staff member
Moderator
Fully suppress refresh is the better solution. Maybe add a checkbox to the assistant, so the user can decide for the current page.
 

avatar

Administrator
Staff member
Administrator
Fully suppress refresh is the better solution. Maybe add a checkbox to the assistant, so the user can decide for the current page.
Then this rule should be enough:
Code:
#%#window.reload = function() {}
 

Blaz

Moderator & Translator
Staff member
Moderator
Then this rule should be enough:
Code:
#%#window.reload = function() {}
And it seems to work, tried it on Boston Herald and so far my highlighted text is still highlighted :), thanks.
 

avatar

Administrator
Staff member
Administrator
No need in JS, CSS is enough:
Code:
reddit.com#$#html, html *, *, body *, body .content *,body #header * { cursor: default!important; }
 

mysteriously

Beta Tester & Translator
I guess this:
Code:
#$#html, html *, *, body *, body .content *,body #header * { cursor: default!important; }
should work on all (most) webpages
Thanks :)

It works too well as it also prevents changing the cursor when pointer hoovers any link :)
 
Last edited by a moderator:
Top