I'm building an extension that checks for a custom TLD then serves an associated IP from a custom DNS. I've tried using chrome.proxy, as well as simple location.host parsing.
chrome.proxy has very weird behavior with a copy-paste from the docs.. reruns the background.js script 60 times or so.
location.host is never called since the "site can't be reached" error page loads and seems to disable the extension background script.
So question is how to hijack chrome's normal url behavior to hook in before the site can't be reached error or how to adjust the DNS lookup to include custom TLDs. It seems possible considering Blockchain DNS has existed since 2018 (albeit with a / workaround that will still require low-level url checks)
Many thanks in advance and please let me know what I'm failing to notice if there's no good solution.
JS in vue app's actions file:
var config = {
mode: "pac_script",
pacScript: {
data: "function FindProxyForURL(url, host) {\n" +
" if (host == 'my.xym/')\n" +
" return 'PROXY localhost:8080';\n" +
" return 'DIRECT';\n" +
"}"
}
};
chrome.proxy.settings.set(
{value: config, scope: 'regular'},
function() {});
odd behavior is multiple calls to the same console log function and chrome.proxy being unavailable: