The webpages of a certain website are all constructed out in sets of tables. Basically, each set of tables is constructed from scripts.
There are about 80 table
tags in the DOM of any webpage I've checked in that site (I counted 77 tables in one page in the DOM). A very old site.
Some element children (td
) include some tables inside themselves.
I Came to the conclusion that webpages in that site are constructed from scripts because of two reasons:
1) Either of these won't work on basically any table element in a webpage:
document.querySelector("#mySelector").style.display = "none";
document.querySelector(".mySelector").style.display = "none";
document.querySelector(" /* LONG-CSS-PATH-TAKEN-FROM-DEVTOOL (via "Copy CSS path") */ ").style.display = "none";
Such action will usually output:
TypeError: document.querySelector(...) is null
Ofcourse, all 3 examples work fine on other websites.
2) There are script segments before different parts of the DOM.
My question:
My question is comprised of the following two questions:
1) How could I prevent loading of a particular script that creates a certain set of tables? (a certain part of the whole webpage)?
- I ask this because it seems to be the only way to hide some elements in this odd layout, given that targeting them traditionally (ID, Class, CSS-PATH) gives the above error.
2) May there be another reason than "loading HTML from scripts" that causes the elements not to be targeted in the traditional way?
Notes:
I run this script from Console.
I also tried to run it with Greasemonkey inside a
window.onload
event handler.