开发者

Alerting website visitors that a chrome extension is available - how?

开发者 https://www.devze.com 2023-01-19 01:02 出处:网络
The Independent website has a little widget that pops up a message informing you that there is an Independent Chrome extension available when you visit it using Chrome (v7 in my case):

The Independent website has a little widget that pops up a message informing you that there is an Independent Chrome extension available when you visit it using Chrome (v7 in my case):

Alerting website visitors that a chrome extension is available - how?

Is this part of the Chrome extensions API - if so how is it achieved (or have they custom-rolled their own JavaScript to make it look 开发者_如何学Clike part of Chrome)? A quick look at the source of the page revealed nothing obvious.


Looks like custom-rolled markup:

<div id="ext_toolbar_text" style="padding-top: 11px; padding-right: 10px; padding-bottom: 10px; padding-left: 38px;
    background-image: url(http://assets.idiomag.com/ext/toolbar/icon.png); background-attachment: initial;
    background-origin: initial; background-clip: initial; background-color: initial; overflow-x: hidden;
    overflow-y: hidden; white-space: nowrap; -webkit-user-select: none; cursor: default; width: 977px;
    background-position: 5px 5px; background-repeat: no-repeat no-repeat;">
        The Independent now has a
        <span id="ext_toolbar_link" style="text-decoration: underline; color: rgb(75, 104, 156); cursor: pointer;">
        Google Chrome Extension</span>. Get the latest news on the topics you like, direct to your browser.
</div>

I selected "Inspect element" on the toolbar to get this.


I hate to be a party pooper but have you considered whether that's the right approach? Trying to fake something that the browser chrome normally does for you is generally considered to be the approach of phishers.

Could you find some way of advertising your extension that fits in better with the design of your site?


I wrote a jQuery extension that does just that: http://blog.dreasgrech.com/2012/01/promoting-your-chrome-extension-with.html

The simplest way to use it is to simply pass the ID of your Chrome extension:

$.fn.extInfobar({
    id: 'nbilgjjflfiiijecdjpnbganoiafneph'
});

And this is what you get:

Alerting website visitors that a chrome extension is available - how?

0

精彩评论

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