"Google Search" with Brakes

Dedicated board for extension releases/support threads

Moderators: FranklinDM, Lootyhoof

Forum rules
Please do not create new topics here unless you are an extension author in need of a dedicated releases&support thread!
User avatar
tellu-white
Lunatic
Lunatic
Posts: 255
Joined: 2022-03-08, 22:02

"Google Search" with Brakes

Post by tellu-white » 2025-09-20, 16:25

River Moon wrote:

I now have Javascript active but strip out all of Google's inline Javascript:

/* Remove inline scripts */
var eli = document.getElementsByTagName('script');
for (var i = eli.length - 1; i >= 0; i--)
{
eli.remove();
}

Getting Google search to play nice can be a constant battle.


https://forum.palemoon.org/viewtopic.php?f=3&t=32723#p265666

***

To make Google Search play nice, it's not enough to remove JavaScript from the page with search results.

***

Removed JavaScript is still executable

Cameron wrote:

$('#someJS').remove();

I can still call example() even though that JavaScript function is no longer inside the DOM... How can I remove it?

T.J. Crowder wrote:

You can't. Script code is executed, creates things in the JavaScript environment, and is completely disconnected from the script element that loaded it. Other than completely reloading that environment, if you don't know what the code did, you can't undo it.


https://stackoverflow.com/questions/29970467/removed-javascript-is-still-executable

***

Unload a Javascript from memory

Tala wrote:

I know it is possible to remove the tag responsible for the content but it is not assured that it will eventually unload and unbind everything correspondent to that content.

T.J. Crowder wrote:

Once the JavaScript is loaded and executed, there is no link between it and the script element that loaded it at all.


https://stackoverflow.com/questions/34997399/unload-a-javascript-from-memory

***

To stop the Javascript code loaded by Google from running, I chose a different approach (with a new add-on). After removing Javascript from the Google Search results page, I copied the code from that page and loaded it into a blank HTML page ( empty_HTML_page.html ). This way, the Javascript code used by Google no longer has access to the copy of the search results page, so it no longer runs.

One problem with this approach is that some images are missing from the copy of the results page. To overcome this problem, I took two additional steps before creating the copy of the results page. I slowly scrolled (from bottom to top) on the original page to force the images to load, then I modified the "src" attribute of these images (I used code taken from the Restore "src" attribute of "img" TAGs 2.1 add-on).

To perform the steps described above, you just need to "click" on add-on button - after the Google Search page with search results has loaded.

The add-on has two other options besides the one described above:

1. With "ctrl + click" on the button, a page similar to Google Search opens, to which Google does not have access. After entering the search text on this page, click on the "Google Search" button (or use the "Tab key + Enter") to open (in the same TAB) the original Google Search page (with the search text).

If no text is entered on the page similar to Google Search and the "Google Search" button is clicked, the original Google Search page ( https://www.google.com/ ) will open (in the same tab) without text to search for.

2. If you press "ctrl + shift + click" on a link in the original Google Search results page, a pop-up will appear with the URL of that link (without the tracking parameters entered by Google) and you will be asked for permission to open that page (in a new tab).

Screenshots:

01.png
02.png
03.png
04.png
05.png
06.png
07.png
08.png
09.png
***

To avoid vertical expanding of some images in the Google Search results page, copy the following CSS code into the "userContent.css", file in the "chrome" folder:

Code: Select all

@-moz-document url-prefix("https://www.google.com/search") { 
	div[role="complementary"] > div { flex: unset !important; }
	.BI6f6d { display: flex; height: calc(38vw * 9 / 16) !important; }
}

@-moz-document url(chrome://google_search_with_brakes/content/empty_HTML_page.html) {
	div[role="complementary"] > div { flex: unset !important; }
	.BI6f6d { display: flex; height: calc(38vw * 9 / 16) !important; }
}
***

Download link ( "Google Search" with Brakes 1.1 ):

https://www.mediafire.com/file/xzfbkf8z54kvwxw/google_search_with_brakes_1_1.zip/file
You do not have the required permissions to view the files attached to this post.

Goodydino
Keeps coming back
Keeps coming back
Posts: 928
Joined: 2017-10-10, 21:20

Re: "Google Search" with Brakes

Post by Goodydino » 2025-09-20, 16:45

Why use Google search if you need to jump through so many hoops? Why not just use Brave search instead? It is a pretty good search engine.

User avatar
billmcct
Board Warrior
Board Warrior
Posts: 1070
Joined: 2012-09-04, 15:19
Location: Union City Georgia USA

Re: "Google Search" with Brakes

Post by billmcct » 2025-09-20, 18:04

I stopped using Google search with the creation of Duck Duck Go.
A decade ago I think.
--------------------------------------------------------------------------------------------------------------
Dell Precision 15 7550
Windows 10 Pro. 22H2 19045.5965
Xeon W-10885M
64 GB DDR4 ECC memory (128 GB max)
2 TB Samsung 9100 Pro main M2 SSD
1 TB Intel storage M2 SSD (very very slow)
500 GB Corsair T500 storage M2 SSD (6 TB max)
Intel onboard GPU 1080p
Quadro RTX 5000 Max-Q GPU 4K

Pale Moon 33.9.x x64 AVX2 build

The difference between the Impossible and the Possible lies in a man's Determination.
Tommy Lasorda

User avatar
tellu-white
Lunatic
Lunatic
Posts: 255
Joined: 2022-03-08, 22:02

Re: "Google Search" with Brakes

Post by tellu-white » 2025-09-20, 18:25

Goodydino wrote:
2025-09-20, 16:45
Why use Google search if you need to jump through so many hoops? Why not just use Brave search instead? It is a pretty good search engine.
My lengthy post probably made you think that using my add-on requires "jumping through so many hoops." In fact, anyone who regularly uses Google Search will only need one extra click to enjoy the advantage of a Google Search results page without JavaScript and without tracking parameters. In my opinion, a single click on the add-on button doesn't mean "jumping through so many hoops."

The other two options provided by the add-on are ... optional ;)

I haven't tested other search engines in a long time, but when I decided to use Google, I tested them all (those available at the time) and concluded that Google provided the best results.

User avatar
billmcct
Board Warrior
Board Warrior
Posts: 1070
Joined: 2012-09-04, 15:19
Location: Union City Georgia USA

Re: "Google Search" with Brakes

Post by billmcct » 2025-09-21, 16:54

If it's just a single click, then for Google users it would be an real advantage.
Will install it and use Google search again.
Thanks, all useful add-ons are most helpful.

EDIT:
I just reread all of this post and found the CSS code to put into the "userContent.css file.
Downloaded the add-on and I suppose it was good to reread.
--------------------------------------------------------------------------------------------------------------
Dell Precision 15 7550
Windows 10 Pro. 22H2 19045.5965
Xeon W-10885M
64 GB DDR4 ECC memory (128 GB max)
2 TB Samsung 9100 Pro main M2 SSD
1 TB Intel storage M2 SSD (very very slow)
500 GB Corsair T500 storage M2 SSD (6 TB max)
Intel onboard GPU 1080p
Quadro RTX 5000 Max-Q GPU 4K

Pale Moon 33.9.x x64 AVX2 build

The difference between the Impossible and the Possible lies in a man's Determination.
Tommy Lasorda