My extension uses code from external servers in the following manner:
- A TXT file containing HTML code resides in a Dropbox account.
- The TXT file's contents are retrieved using jQuery (
$.get
). - After parsing the data as HTML code, it is written as-is onto the current webpage (
document.write(plaintext)
).
So the current webpage could be any webpage, like "http://current.com" (the domain is actually owned by me, if it matters). The HTML code itself, which is downloaded and then written on the page, references CSS and JS files from other external domains (from other storage accounts that I own).
This used to work fine, because Chrome extensions are allowed to request data from external domains. However, suddenly, in a specific case, it stopped working, and I get errors:
CSS stylesheet from origin [external domain name that stores the CSS file] has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin [current domain] is therefore not allowed access.
What am I missing? Why suddenly can't the extension get the data, like it did before?
I already read the "standard" questions like the following links, and of course the manifest file has <all_urls>
in the permissions.
No 'Access-Control-Allow-Origin' header is present on the requested resource
Cross-Origin XMLHttpRequest in chrome extensions
No 'Access-Control-Allow-Origin' header is present on the requested resource.