开发者

A browser addon that makes a box pop up in the corner on certain domains

I want to create an addon where when you open a webpage from certain domains, a square or circle (not sure which yet) image will pop up on the corner of the page.

The closest example I can think of is the GetGlue addon. When you are on a page from specific domains, the toolbar pops up on the bottom and gives you options to pursue while you are on the page. Then once you go to a non-supported website, the toolbar is gone.

However the one I want to create is much m开发者_StackOverflow中文版ore simpler where I just want an image to show up in the top corner of the page when you arrive at certain webpages, and disappear once you move to a domain not supported. It's not going to do anything or link anywhere or have any actions; it's just an image.

I don't know much about creating addons, but I am willing to learn how to do so as creating this is of somewhat importance to me. But I've been looking around, and I've come across things to get people started on creating them, but I don't really know how to go about it as I've not sure how I can get what I want done, and the ones I see are about things not related.

If anyone knows of any guides or tuts or anything similar that can explain the basics or even some more in-depth of doing what I want done, many thanks are sent your way.


Look into content scripts

This allows you to inject JS and CSS into any page that matches a url pattern

For example, including the following in your manifest will insert mystyles.css into any page under http://www.google.com/

"content_scripts": [
    {
       "matches": ["http://www.google.com/*"],
       "css": ["mystyles.css"]
    }
],
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜