Currently developing a Firefox extension to scrape specific data from a website.
The website features an index page that lists links to subsidiary pages containing the desired data. Upon visiting the index page, the extension prompts to scrape the data. If confirmed, the content script collects the subsidiary page URLs and sends them to the background process which then opens each page in new tabs, scrapes the data, and closes the tab after completion. To prevent server issues, there are timed intervals set for opening new tabs, currently at 10-second intervals.
Once all data is scraped, it needs to be sent to a PHP script on a server (which is not within the scope of this question).
While the functionality works as intended, an error message appears in the console for each opened and closed tab:
15:06:27.426 Uncaught (in promise) Error: Invalid tab ID: 171
Despite the code functioning correctly, I have been unable to identify the source of this error after investigating throughout the day.
Query: Where is this error originating from, and what steps should be taken to resolve it?
Below is the provided code snippet:
//async function and other functions outlined here...
The code contains multiple console.log()
statements for debugging purposes. Here is a sample of the console output:
Sample console outputs displayed here.
Additional information:
- The
scrapeMileage.js
script currently serves no functional purpose besides returning a static value. - The data being retrieved is personal information used solely for my own needs. Once the system is fully operational, each page will only be scraped once.
- For privacy reasons, the actual URLs involved have been obfuscated.