Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Calculator

0

47
Views
My chrome extension doesn't run at first time
"content_scripts": [
  {
    "matches": ["*://*.example.com/page2"],
    "js": ["contentScript.js"],
    "run_at": "document_idle"
  }
]

Well, the home page is "example.com/page1" that home page has a link <a href="/page2"></a> when I click at that link I would expected that my contentScript.js was injected at the page, but it doesn't happen, for that happens I need to refresh the page, only then contentScript.js works.

When I put at adress bar "example.com/page2" and search the contentScript.js works perfectly, but if I try to acess the page2 from the link that have at page1 it doesn't work, so I need to refresh the page.

I dont want to need refresh the page everytime. How do I fix it?

7 months ago ยท Juan Pablo Isaza
Answer question
Find remote jobs