How to access localstorage of unopened website from chrome extension

I am working on a chrome extension. I want the chrome extension, everytime that it is opened, to grab a value from the localstorage of the companion website. This needs to be done on every open to preserve consistency of my application/extension.

On all the other stack overflow pages, it looks like the actual tab/window of the website has to be open in order to inject a content script and access its localstorage. However, in the case of my app, that would create a terrible UX.

Is there any way to access localstorage of a website without having the tab open?

Thanks

Chrome Web Server won’t shut down

I’ve installed the Chrome Extension “Chrome Web Server”. I pointed it to a local folder C:works. That worked, I was able to run the website. Unfortunately, when I run any other Node application locally, Chrome now always displays the site at C:works at localhost:3000. I’ve even deleted the extension, but still am unable to run any other local web app – localhost:3000 always just still points to the site configured in Chrome Web Server- that I deleted!

I am able to view the other Node apps in other browsers at localhost:3000, but not Chrome.

How Could My Chrome Profile Cause Chrome Extension Error: “Extension manifest must request permission to access this host.”

When I install the “Page Redder” sample Chrome extension (https://developer.chrome.com/extensions/samples) on my main profile it works for most sites, but not for Google Docs. If I try to use the extension to make Docs “redder” I get:

Unchecked runtime.lastError while running tabs.executeScript: Cannot access contents of url “chrome-devtools://devtools/bundled/devtools_app.html?remoteBase=https://chrome-devtools-frontend.appspot.com/serve_file/@1c32c539ce0065a41cb79da7bfcd2c71af1afe62/&dockSide=undocked“. Extension manifest must request permission to access this host.
at chrome-extension://cianfokdkklhngjaknijlbfkpbgbgaib/background.js:9:15

Where background.js lines 8-10 are:

chrome.tabs.executeScript({
    code: 'document.body.style.backgroundColor="red"'
});

However, if I do the exact same thing from a fresh profile it works just fine on Google Docs (it doesn’t make the page red because of Doc’s styles, but it doesn’t cause an error). I thought maybe one of my other extensions was interfering with it so I disabled all of them (including the Google Docs ones) and yet still have the same problem.

So, my question is, what could I possibly have in my Google Chrome Profile that would cause such an error in the Chrome sample extension, even with all extensions disabled, but only on Google Docs. And if possible I’d like to know how I can “clean” my profile to eliminate it.

Unable to make chrome extension

I need help with a chrome extension, nothing I seem to do works. Most of what I could source isn’t of much help. What do I need to edit here?

Here is the code:
HTML




WebApp










Processing
Processing

JS:

// Quote generator
var strings = [
 'Only I can change my life',
 'Optimism is the faith that leads to achievement',
 'With the new day comes new strength and new thoughts',
 'Life is 10% what happens to you and 90% how you react to it',
 'Failure will never overtake me if my determination to succeed is strong enough'
];
var rand = strings[Math.floor(Math.random() * strings.length)];
document.getElementById('loading-text').innerHTML = rand;

// Loader
function timerOne() {
    myVar = setTimeout(showPage, 3000);
}

function showPage() {
  document.getElementById("loader").style.display = "none";
  document.getElementById("myDiv").style.display = "block";
}

// Create a "close" button and append it to each list item
var myNodelist = document.getElementsByTagName("LI");
var i;
for (i = 0; i < myNodelist.length; i++) {
  var span = document.createElement("SPAN");
  var txt = document.createTextNode("u00D7");
  span.className = "close";
  span.appendChild(txt);
  myNodelist[i].appendChild(span);
}

// Click on a close button to hide the current list item
var close = document.getElementsByClassName("close");
var i;
for (i = 0; i < close.length; i++) {
  close[i].onclick = function() {
    var div = this.parentElement;
    div.style.display = "none";
  }
}

// Add a "checked" symbol when clicking on a list item
var list = document.querySelector('ul');
list.addEventListener('click', function(ev) {
  if (ev.target.tagName === 'LI') {
    ev.target.classList.toggle('checked');
  }
}, false);

// Create a new list item when clicking on the "Add" button
function newElement() {
  var li = document.createElement("li");
  var inputValue = document.getElementById("myInput").value;
  var t = document.createTextNode(inputValue);
  li.appendChild(t);
  if (inputValue === '') {
    alert("You must write something!");
  } else {
    document.getElementById("myUL").appendChild(li);
  }
  document.getElementById("myInput").value = "";

  var span = document.createElement("SPAN");
  var txt = document.createTextNode("u00D7");
  span.className = "close";
  span.appendChild(txt);
  li.appendChild(span);

  for (i = 0; i < close.length; i++) {
    close[i].onclick = function() {
      var div = this.parentElement;
      div.style.display = "none";
    }
  }
}

The Manifest:

   {
  "manifest_version": 2,
  "name": "Webapp",
  "version": "1.0",
  "description": "Webapp",
  "matches": [""],
  "js": "script.js",
  "browser_action": {
  "default_icon": "image.png",
  "default_title": "Webapp",
  "default_popup": "webapp.html"
},
"permissions": ["tabs","activeTab"]
}

I'm not sure as to why the code is not loading properly. Let me know what I should do. (If possible, send an edited version of the current code.)