Chrome Inspect Views Needs To Be Open For Extension To Function

I’ve been developing a Chrome Extension, but I’m relatively new to extension development. So I apologize for my newb-ness. I’ve been running into a weird bug, though, and I’d appreciate any input that could point me in the right direction.

I’ve developed an extension that grabs content from the active tab and saves it to a database via some custom API calls. All of this happens after doing an OAuth handshake with Github. What’s weird, though, is that unless the Inspect Views Background Page is open, then it neither grabs content from the active nor does it make any API calls. However, as soon as I re-open the Inspect Views console, everything works perfectly.

Any idea what this could be?

How do I delete JSConsole memory when the trash icon and right click “delete console history” do not work?

When I click the trashcan in a Google Chrome Dev Tools JS console or Firefox’s Scratchpad the screen clears. However, the memory of const and let variables remains. When I delete console history, sometimes it stays as well. Is there an alternative to refreshing the browser? With Scratchpad I may need to open, close, and reopen. I’m trying to save time so that I can practice. I’m extremely new to programming.

How to find JavaScript event running on site?

I want to find the javascript events that run on the website when user performs a certain action(press order button on an ecommerce store). I read this question but when I don’t understand what event listner to turn on to find the event.

Trying to fix a loop that edits React posts on a page using DevTools

I’m trying to solve the problem of having DevTools console delete all posts on my Facebook profile.

The first time the loop runs it works! But the second iteration I get this error…

“This content is no longer available
The content you requested cannot be displayed right now. It may be temporarily unavailable, the link you clicked on may have expired, or you may not have permission to view this page.”

Pretty sure it’s a DOM re-render that isn’t being triggered by React or something??

I want to solve this. Any help is much appreciated. 🙂

function rando (min, max) {
  return Math.floor(Math.random() * (max - min + 1)) + min;
}

function time (milliseconds) {
  return new Promise(resolve => setTimeout(() => resolve(), milliseconds));
}

function first () {
  var expand = document.querySelector('a[aria-label="Story options"]');
  expand.click();
  expand = null;
}

function second () {
  var deletePost = document.querySelector('a[data-feed-option-name="FeedDeleteOption"]');
  deletePost.click();
  deletePost = null;
}

function third () {
  var confirm = document.querySelector('.layerConfirm');
  console.log(confirm);
  confirm.click();
  confirm = null;
}

async function go () {
  const times = 10;
  let ran = 0;
  let random = rando(3000, 3500);

  while (ran < times) {
    first();
    await time(random);
    second();
    await time(random);
    third();
    await time(random);

    ran++;
  }
}

go();

Chrome console: snippet command can’t open dialog

I have a simple oneline snippet to “click” on a «load file» button on a visible page to call a dialog-popup (to load an image, for example).

this.document.getElementsByName("image")[0].click()  // snippet code 

While manual paste and run this line in console is successful (it opens the dialog), the above snippet can’t do that. Seems like Chrome doesn’t allow to open dialog not by user call. So, I set browser to allow all popups but there is no result.

Tested on different pages where file load button presents.

Thanks for any ideas.

A similar but different issue, solved