Search code examples
mysqlscreen-scrapingcross-domaingoogle-chrome-extension

Sending MySQL query to site I own from a different site (using Google Chrome Extension)


I want to write a Google Chrome Extension that can take information from a site that I do not own (www.notmysite.com), send that info to a site I do own (www.mysite.com), and do some sort of MySQL query with that information on my site.

For example, I'd like to be able to take some javascript variable that I've parsed from the HTML on www.notmysite.com and INSERT it in the MySQL database on www.mysite.com. I have no problem making XMLHttpRequests from one www.notmysite.com page to another, but am running into cross-domain scripting restrictions when I try to connect to www.mysite.com.

Is there a way around this? It seems like there should be since I own www.mysite.com!

(This is essentially a screen scraping problem. I want to screen scrape straight to a database.)


Solution

  • You can avoid cross domain restrictions if you run your ajax call from a background page (not from a content script) and have corresponding domain permissions declared in manifest file.