webRequest domain filter
dielduarte opened this issue · comments
currently, the webRequest API sends events ignoring the active domain that the tab was opened
hey @StanleySathler! I did some tests here and all we should do is to pass the URL or the array of URLs to the listeners, something like that:
chrome.webRequest.onBeforeRequest.addListener(
callback,
{ urls: [url] } <- here we can add the URL or array of URLs to watch
);
we can't just get the location since API URL's are used to be different than the app domain, the solution I thought was to add a little settings field so the users can add the desired APIs URLs they want to watch and we save it to the localStorage, how about this idea below?
user clicks on the Settings icon:
users can now close clicking in the close icon or outside the modal.
users starting writing: the close icon turns into the save icon and then when clicking in the save icon we save the values to the localStorage and start the listeners.
then next time the user opens the dev tools we just start the listeners reading the values from localStorage.
I'm gonna work to implement it tomorrow, let me know what do you think!
fun fact: URLs can be added like: *.mydomain.com
or api.*