There is a website that already exists and it has an ad that disappears after a countdown via JavaScript the runs a function to remove the ad.
I know what the function is and everything and I am trying to make a program for myself and friends to use to bypass this ad.
After some research it looks like using a chrome extension is the best way.
I currently have
{
"name":"Ad skip",
"description":"ad skip",
"version":"1",
"manifest_version":2,
"content_scripts": [
{
"matches": ["http://www.webiste.com/*","https://www.website.com/*"],
"js": ["myscript.js"]
}
]
}
as my manifest file, an I'm pretty sure what I need is the content script to have the code that calls that function.
The name of the function in this case we'll call hide_ad();
Preferably I would like a way to make this inject an onload="hide_ad()" into somewhere.
I've already tested moving the function call to other places in the code by using "inspect element" and self injecting an onclick="hide_ad()" onto a <div>
with a random image that was already on the page and it worked