Hi all, sorry if this is a novice question, but I'm fairly new at this and couldn't find a similarly answered question on SO or previous threads--
basically I'm trying to add a listener for when a specific url is visited.
Specifically I'm trying to get a listener initiate a function that will make a modification to the 'enabled' property of a ruleset in declarative_net_requests in my manifest, but I'm working through things step by step.
after looking through the documentation for events and runtime and whatnot I found one that looks like it might work for me.
in webNavigation there's an onCompleted event that seems to be what I want. After the url has successfully been accessed it should trigger -
in the listener function properties it says you can add details to specify the url, but I can't quite understand the syntax of how to do that correctly.
My current code is below, but even when I omit the details object ({url:...} in the code below) I'm getting an error when trying to upload my extension because registering my service worker is failing.
chrome.webNavigation.onCompleted.addListener(
function(){
console.log('beep boop');
alert('beep boop');
},
so the url is a placeholder for now, but just to test how the listeners work I was trying to get an alert popup to occur whenever I visit the named url.
Am I on the right track here?
Thanks for your help