Chrome extension parsing RSS

956 Views Asked by At

I'm working on an extension for Chrome that uses an RSS parser, however I have used several different methods and I keep getting the error: "XMLHttpRequest cannot load Example.rss. Origin chrome extension://djhppbppokfmldecpcfbcmchagimpmpc is not allowed by Access-Control-Allow-Origin."

Tried using the AJAX feed and jFeed methods in the first answer below but neither worked for me.

How to parse an RSS feed using JavaScript?

Here's my JavaScript function:

   jQuery.getFeed({
   url: 'http://example.rss',
   success: function(feed) {
       alert(feed.title);
   }});

My Manifest.JSON looks like

"manifest_version": 2,
"version": "1.0",
"permissions": ["http://*/", "tabs"],

Any help would be greatly appreciated.

2

There are 2 best solutions below

0
On

Your specified host permission is missing a path.

Change http://*/ to http://*/*

For more info, see the chrome documentation on match patterns.

0
On

You need to add CSP in your manifest. Something like this line, but change example.com to your feed:

content_security_policy": "script-src 'self' https://example.com; object-src 'self'

For more read this: CSP in Chrome extensions