Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

185
Visualizações
Content Script doesn't run until page reload

Although there are a lot of similar questions here, I couldn't solve my problem with any of the accepted solutions, so I'm creating a new question.

I have a content script that adds some functionality to a Jira Issue. However, when navigating to the Jira Issue from a Filter Results Page, the content script doesn't run until I manually reload the page.

What I've tried so far:

  1. Adding webNavigation Listeners (with the manifest permission), but none of them seem to trigger when the Jira Issue link is clicked from the Filter Page.
// background.js

const myLog = () => console.log('webNavigation event triggered');

browser.webNavigation.onDOMContentLoaded.addListener(myLog);
browser.webNavigation.onHistoryStateUpdated.addListener(myLog);
browser.webNavigation.onReferenceFragmentUpdated.addListener(myLog);
  1. Adding "all_frames": true to the manifest.json, but that didn't make it work either:
// manifest.json

...

"background": {
    "scripts": ["background.js"],
    "persistent": false
  },
"content_scripts": [
    {
      "matches": ["*://jira.atlassian.com/*"],
      "js": ["content.js"],
      "all_frames": true
    }
  ],
"permissions": ["tabs", "webNavigation", "<all_urls>"]
  1. Listening to window.onpopstate event inside the content script. Although it detects when I click the "Back" and "Forward" arrows in the browser, it doesn't fire when I click the links inside the Filter Results Page.
// content.js

window.onpopstate = () => {
 browser.runtime.sendMessage('webNavigation event triggered');
}

How can I run this content script without having to manually reload the page?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda