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:
***
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


