I'm brand new to Chrome Extensions, but it looks like something I could have fun with so I'm trying to figure out what I have to work with.
After reading the documentation and looking at some examples, I'm curious what the best way would be to trigger the page_action
icon based on a tab URL. After doing some reading, I came across two examples so far:
First there is the page action by URL as described here. It looks like it uses declarativeContent
which I don't fully understand even after reading the documentation. If someone has a better way of explaining it, I'm all ears.
The second was is to do something like what's mentioned here. To me, doing something like this if (tab.url.indexOf('http://specificsite.com') == 0)
makes more sense than the things that the declarativeContent
method was doing.
Is there a better way to do this than these 2 approaches? If not, what is the best way to trigger a page_action
by URL?
Thanks!