0

I have a little problem whit my chrome extension. The extension works if I'm on a URL that not uses fragment. Now sure on how to configure it.

Im trying with definition < all_urls > but as I wrote. it does not work on pages with fragment.

manifest.json

{
"update_url": "https://clients2.google.com/service/update2/crx",

    "name": "Analytic Live Alarm",
    "version": "0.3",
    "description": "Felipe the solution provider",
    "permissions": [
    "tabs","<all_urls>"
    ],
    "browser_action": {
    "default_icon": "icon.png"
    },
    "icons": { 
                "16": "icon.png",
                "48": "icon.png",
                "128": "icon_128.png" 
            },
    "content_scripts": [
        {
        "matches": [
                "<all_urls>"
            ],
        "run_at": "document_end" ,
          "js": ["jquery.min.js", "script.js"]     
        }
    ], 
    "manifest_version":2
}

This is the url Im using. https://www.google.com/analytics/web/#dashboard/6I8yfVs_TqSQ_b1tOJYR0Q/a8398197w15972131p74378741/

Any ideas?

Thanks

Dymond
  • 2,158
  • 7
  • 45
  • 80

1 Answers1

0

Taking into account your previous question..

It's not "not working", it's working once; then, as you navigate, the page is not really reloaded, and your script does not run again.

Instead of coloring all elements at document_end, you need to detect new elements that match your selector and re-apply your styles.

This question should help you get started, or better yet mutation-summary library.

Community
  • 1
  • 1
Xan
  • 74,770
  • 16
  • 179
  • 206