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

  • SEARCH
  • Home
  • 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 8150265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:01:10+00:00 2026-06-06T15:01:10+00:00

I am trying to develop an extension that will work with Awesome New Tab

  • 0

I am trying to develop an extension that will work with Awesome New Tab Page. I’ve followed the author’s advice to the letter, but it doesn’t seem like any of the script I add to my background page is being executed at all. Here’s my background page:

<script>
    var info = {
        poke: 1,
        width: 1,
        height: 1,
        path: "widget.html"
    }

    chrome.extension.onRequestExternal.addListener(function(request, sender, sendResponse) {
        if (request === "mgmiemnjjchgkmgbeljfocdjjnpjnmcg-poke") {
            chrome.extension.sendRequest(
                sender.id,
                {
                    head: "mgmiemnjjchgkmgbeljfocdjjnpjnmcg-pokeback",
                    body: info,
                }
            );
        }
    });

    function initSelectedTab() {
        localStorage.setItem("selectedTab", "Something");
    }

    initSelectedTab();
</script>

Here is manifest.json:

{
    "update_url": "http://clients2.google.com/service/update2/crx",
    "background_page": "background.html",
    "name": "Test Widget",
    "description": "Test widget for mgmiemnjjchgkmgbeljfocdjjnpjnmcg.",
    "icons": {
        "128": "icon.png"
    },
    "version": "0.0.1"
}

Here is the relevant part of widget.html:

<script>
    var selectedTab = localStorage.getItem("selectedTab");

    document.write(selectedTab);
</script>

Every time, the browser just displays null. The local storage isn’t being set at all, which makes me think the background page is completely disconnected. Do I have something wired up incorrectly?

  • 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-06T15:01:12+00:00Added an answer on June 6, 2026 at 3:01 pm

    Obviously, I ditched this project months ago out of frustration. I finally decided to revisit it today, and here’s what I discovered:

    1. The localStorage object is cached (go figure), which explains why the extension would work sometimes and the suddenly not work long after I had made a breaking change to the code. This also explains why the extension would continue not to work long after I had fixed it. For future reference, reloading the extension from Chrome’s extension manager clears the localStorage cache for the extension.
    2. The background page for a Chrome extension (at least in the case of an ANTP extension) MUST be a HTML file. It will not work if it’s a JS file.
    3. I used to be REALLY bad at JavaScript.

    Here’s the updated code, which you can use as a shell for your own Chrome or ANTP extension. I’ve also included the changes required by ANTP for using poke v2.

    background.html:

    <html>
        <body>
            <script>
                (function () {
                    "use strict";
    
                    var info = {
                        poke: 2,
                        width: 1,
                        height: 1,
                        path: "widget.html",
                        v2: {
                            resize: false,
                            min_width: 1,
                            max_width: 1,
                            min_height: 1,
                            max_height: 1
                        }
                    };
    
                    chrome.extension.onRequestExternal.addListener(function (request, sender, sendResponse) {
                        if (request === "mgmiemnjjchgkmgbeljfocdjjnpjnmcg-poke") {
                            chrome.extension.sendRequest(
                                sender.id,
                                {
                                    head: "mgmiemnjjchgkmgbeljfocdjjnpjnmcg-pokeback",
                                    body: info
                                }
                            );
                        }
                    });
    
                    localStorage.setItem("foo", "bar");
                }());
            </script>
        </body>
    </html>
    

    manifest.json is exactly the same. Here are the relevant parts of widget.html:

    <script>
        (function () {
            "use strict";
    
            var foo = localStorage.getItem("foo");
    
            document.write(foo);
        }());
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to develop an extension that will work similar to the Comment
I was trying to develop a Chrome extension that can display me the last
Hi all I am trying to develop an android extension for air, but I
I'm trying to develop an extension that detects every connection made by the browser
I'm new to the programming world & i'm trying to develop an extension for
I'm trying to develop a firefox extension that inserts additional HTTP header fields into
I am trying develop a basic referrer system to my Django website, system will
I`m trying to develop an interface just like Twitter, but check the images how
im trying to develop an app for a win CE mobile device that downloads
So I am trying to develop a app that lets you see the current

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.