Check Chrome extension installed or no (?)

Hello.

Frankly I do not know and many do not know how to identify whether there are betterways to do this, and correct, but I’m sure that there will be. However, my code isperfectly copes with this task.

https://wrongscript.wordpress.com/2011/11/17/chrome-extension/

when i make this extension, i want create download link in my website.

if user downloaded this extension (crx file) and user use this my chrom extension, i dont want create download link in my webpage.

for simply, in my website is index.html and there is content

<div id=”chrome_extension”>

   <div ….

                   <a href=”example.crx”></a>

        </div>

</div>

and i have extension.js file, with content (Jquery):

$(function() {

if($.browser.safari) {}; // if it is not chrome browser, i dont want chrome extension!

//and check extension image, for my chrome extension

var img;
img = new Image();
img.src = “chrome-extension://” + “AAAPPAAPAPA” + “/logo.png”;

// it is extension logo address. and  “AAAPPAAPAPA” <- is extension unique ID.

// and then

img.onload = function() { 
     $(“#chrome_extension”).hide();
};

// if image logo is load, if for this unique id isset logo.png – dont want this extension!

});

Sorry again for my shirt english : )

BEST REGARDS 😉

Advertisements

Create Simply Chrome Extension

This is simply extension, without upload google server.
Make CRX file and You can update manually this google chrome extension.

You Need File: manifest.json

This file content is:

{ { … } <- this is comment (with bold) }

{
“name”: “{Extension Name}“,
“version”: “{extension version (e.g. 1.5). it is for update!!! }“,
“description”: “{Extension description}“,
“icons”: {
“32”: “icon32.png”, {It is icons 32, 48 and 128 X pixel, for all views…}
“48”: “icon48.png”,
“128”: “icon128.png”
},

{ AND NEXT }

“browser_action”: {
“default_icon”: “logo.png”, {extension icon}
“popup”: “index.html” {open index.html file}
},

{ AND NEXT }

“permissions”: [
“tabs” {only tabs, becose i want open only index.html simply file}
],
“update_url”: “{here is url http://…example.xml it is for update with version (version: 1.5->1.6) .}
}

NEXT FILE IS index.html with content:

<style>
….
….

</style>

AND

<script>

function home() { {this function is, for open in new tab this URL}
chrome.tabs.create({url:”http://www.example.com&#8221;,selected:true});
}

</script>

AND

OPEN HOME PAGE

{this is html code and when click – open page http://www.example.com}

<p onclick=”home()”> Click for Home page </p>

 

AND THEN GO TO google chrome -> Option -> Tools -> Extensions

1)PACK EXTENSION;
2) set “Extension root directory:”;
3) click PACK EXTESNION (without private key)

then one up level folder we have two files:
1. —.crx
2. —.pem

AND THEN

OPEN this CRX file (with mouse drop) in google chrome and install this extension.
then go to again google chrome -> Option -> Tools -> Extensions.
in our extension is arrow – “>”. click this arroy and we can read extension ID.

AND THEN

example.xml content:

<app appid=”{sadflkasjdflaskdjfsald}“>

{appid – it is EXTENSION ID }
and we have crx file.

_____________________________________________

FOR UPDATE we can make our chrome extension new version.

in json file write more version (e.g. 1.5 more -> 1.6 , 2.0, 5.9 and other)

change anything in script what you want and then pack crx again (google chrome -> Option -> Tools -> Extensions.)
* next version we wonna make pack with —.pem file, for unique ID, for update with XML file.

_________

sorry for my bad english : ) good luck

Wrong Script !

WrongScript – It’s just a name. We want to write correct scripts. Good Luck!