In my contents of the chrome script extension, I click on certain links / buttons on web pages from specific sites. For this, I use the following code in the script content (I embed jQuery in the script content):
$(css_selector).trigger("click")
This works on most sites.
However, on some sites, such as delta.com, match.com, and paypal.com, this method of triggering an item click does not work. On delta.com, I get the following exception that occurred while trying to run a script in the content:
Error: An attempt was made to reference a Node in a context where it does not exist. Error: NotFoundError: DOM Exception 8
The strange thing is that if I open javascript consoleon delta.com, turn on jQuery and try the same piece of code to run the code, it works.
On match.com and paypal.com, the trigger simply does not work in the content script, and there is no error. I can't even fire the click event through the javascript console like I did on delta.com.
If I manually use the mouse click, everything works fine on all three sites. So I also tried to simulate this use of mousedown (), mouseup (), but that didn't work either.
This seems to be a problem because javascripts from these sites capture and ignore events. I tried reading the code from these sites to see what was happening, but there was too much code.
Does anyone have an idea of ββwhat's going on here and how to fix it?
javascript jquery google-chrome-extension
Methos
source share