Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7845817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:22:15+00:00 2026-06-02T17:22:15+00:00

I am trying to do a RSS reader chrome extension based on an example

  • 0

I am trying to do a RSS reader chrome extension based on an example from lifehacker (http://lifehacker.com/5857721/how-to-build-a-chrome-extension). I did my own based on that. It didn’t work. I tried their source code and it worked perfectly fine(for lifehacker), but when I changed the xml source as http://www.engadget.com/rss.xml it only showed an empty square.If anyone can point any mistake or error, I would be truly thankful.My files are :

manifest.json

  {
  "name": "RSS Fetcher",
  "version": "0.1",

  "description": "engadget rss reader.",
  "homepage_url": "http://www.engadget.com/",
    "background_page": "background.html",
    "permissions": [
      "<all_urls>",
      "http://www.engadget.com/*"


],
    "browser_action": {
    "default_title": "engadget reader",      
    "default_popup": "popup.html"       
  }
}

background.html

    <html>
<head>
    <script src='scripts/jquery-1.6.1.min.js'></script>
    <script src="scripts/parse.js"></script>
    <script>


        function fetch_feed(url, callback) {
            var xhr = new XMLHttpRequest();
            xhr.onreadystatechange = function(data) {
              if (xhr.readyState == 4) {
                if (xhr.status == 200) {
                  var data = xhr.responseText;
                  callback(data);
                } else {
                  callback(null);
                }
              }
            }
            // Note that any URL fetched here must be matched by a permission in
            // the manifest.json file!
            xhr.open('GET', url, true);
            xhr.send();
        }   


        function onRequest(request, sender, callback) {
            if (request.action == 'fetch_feed') {
              fetch_feed(request.url, callback);
            }
        }

        // Wire up the listener.
        chrome.extension.onRequest.addListener(onRequest);      


    </script>
</head>
<body>
</body>
</html>

popup.html

<html>
<head>
    <script src='scripts/jquery-1.6.1.min.js'></script>
    <script src="scripts/parse.js"></script>
    <script>

        function fetch_feed() {
            chrome.extension.sendRequest({'action' : 'fetch_feed', 'url' : 'http://www.engadget.com/rss.xml'}, 
                function(response) {
                    display_stories(response);
                }
            );
        }

        function display_stories(feed_data) {
            var xml_doc = $.parseXML(feed_data);
            $xml = $(xml_doc);
            var items = $xml.find("item");
            $('#popup').html('<img src="images/logo.png" id="logo" onclick="open_item(\'http://engadget.com/\'); window.close();" /><br clear="all" />');
            items.each(function(index, element) {
                var post = parse_post(element);
                var item = '';
                var class2 = '';
                if (index >= localStorage['unread_count']) {
                    // // console.log('visited');
                    item += '<div class="post read">';
                }
                else {
                    item += '<div class="post">'
                }
                item += '<span class="tag">' + post.tag + '</span>\
                            <a href="' + post.url + '">\
                                <div id="' + post.id + '" class="item" onclick="open_item(\'' + post.url + '\');">\
                                    <img src="' + post.img + '" width="107" height="60" />\
                                    <h4>' + post.title + '</h4>\
                                    <span class="description">' + post.description + '...</span>\
                                </div>\
                            </a>';
                item += '</div>';
                $('#popup').append(item);
            });
        }

    </script>
    <link rel="stylesheet" href="styles/post.css" type="text/css" />
</head>
<body>

    <div id="popup">

    </div>
    <script>
        $(document).ready(function() {
            fetch_feed();
        });
    </script>
</body>
</html>

parse.js

function parse_post(element) {
    // console.log(element);
    var post = new Object();
    post.title = $(element).find("title").text();
    post.tag = post.title.split('[')[1].split(']')[0];
    post.title = post.title.split('[')[0];
    post.id = $(element).find("guid").text();
    post.url = $(element).find('link').text();
    post.description = $("<div/>").html($(element).find("description")).text();
    post.img = $('img', post.description)[0].src; //107x60px
    var shorten = 120;
    if (post.title.length > 80) {
        shorten = 70;
    }
    post.description = $.trim($(post.description).text());
    post.description = post.description.substr(0, shorten);
    // console.log(post);
    return post;
}

function open_item(url) {
    chrome.tabs.create({url: url});
    chrome.browserAction.setBadgeText({text:''});
}

I also used jquery-1.6.1.min.js
Anything helps:) Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T17:22:16+00:00Added an answer on June 2, 2026 at 5:22 pm

    not sure “all_urls” works in your manifest.json, remove that and give it a try

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to put together a simple RSS reader, and found code on http://www.ibm.com/developerworks/opensource/library/x-android/
Trying to parse out lat/lon from a google maps rss feed: $file = http://maps.google.com/maps/ms?ie=UTF8&hl=en&vps=1&jsv=327b&msa=0&output=georss&msid=217909142388190116501.000473ca1b7eb5750ebfe;
I am trying the RSS Feed code from this website (http://javamix.wordpress.com/category/programs/rss-feed/) It worked fine.
I am using this http://imthi.com/blog/programming/iphone-rss-reader-application-with-source-code.php as a start for my rss reader in my
I've been using this PHP/AJAX rss reader http://www.w3schools.com/php/php_ajax_rss_reader.asp - it works well, but I
I'm trying to build a RSS reader, but I'm having trouble with saving the
I am new to android and i am trying to build a RSS reader
I am trying to build a RSS feed reader for my application and I
I am trying to build an RSS reader for the Tom's Hardware website. I
am trying here to build rss reader , the problem that when user finish

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.