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 7791067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:46:22+00:00 2026-06-01T21:46:22+00:00

As a simple example, let’s say I want to insert a word at the

  • 0

As a simple example, let’s say I want to insert a word at the bottom of every webpage, and I want the user to be able to change that word. So I have an options page (within the extension), within which I take user input and use it to call “localStorage.preferences = x;”.

Next, the user navigates to http://www.google.com/, and I inject a script which writes the word found in localStorage.preferences. The problem is, since I’m now at a different domain, I’m seeing the localStorage for google.com, not my extension.

How can I share data between my extension’s options page and a script injected into some 3rd-party webpage?

  • 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-01T21:46:24+00:00Added an answer on June 1, 2026 at 9:46 pm

    It’s not, perhaps, the most direct response to your question, but one way to potentially get around this would be to use message passing to fake direct access to local storage from another domain. Assuming you’re running your Javascript in the context of a content script, you could pass a message to the background page asking for a key, which would return the contents of localStorage.

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

Sidebar

Related Questions

A simple example: Let's say I have one alias being sourced somewhere as: alias
Can someone provide a simple example of how to properly use Html.RadioButtonFor? Let's say
Let's look at a simple example of a dog and a cat that are
Let's create a very simple example file: index.php : <?php $connection = mysqli_connect('localhost', 'user',
As a simple example, let's say you have this matrix: M = [omega 1;
Really simple example: Let's say I have this table: ID Name GUID1 John GUID2
Let's take a simple example of an object Cat . I want to be
As a simple example, I want to write a CLI script which can print
Let's take a really simple example on using jQuery to ajaxify our page... $.load(getOrders.aspx,
Let's say I have the following simple query SELECT TOP 1 name FROM months

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.