var base_url = undefined // Get the list of all feeds, combining bridged and native feeds async function get_feed_urls() { let settings = await browser.storage.sync.get("rb"); base_url = settings.rb; let all_feed_urls = [] for (const bridge of bridges) { for (const host of bridge.hosts) { if (window.location.host.includes(host)) { result = await bridge.callback() all_feed_urls = all_feed_urls.concat(result) break } } } all_feed_urls = all_feed_urls.concat(find_feeds_in_page()) return all_feed_urls } // Function to register a new bridge let bridges = [] function register(hosts, callback) { bridges.push({hosts, callback}) } browser.runtime.onMessage.addListener(function (msg, sender) { return Promise.resolve(get_feed_urls()); })