inline-installation chrome extension

2,338 views
Skip to first unread message

Tuấn Trần

unread,
Sep 9, 2015, 11:58:55 AM9/9/15
to Chromium-extensions
Hello, i have an extension and a website. I want to the user install my extension in my website, so i choose the way inline-installation to install my extension.
This is my code JS to add extension:
        function successCallback() {
            window
.alert('success');
       
}


       
function failureCallback() {
            window
.alert('failure');
       
}


       
       
function ExtInstall() {
           
if (chrome.app.isInstalled)
                alert
("already installed!");
           
else
                chrome
.webstore.install('https://chrome.google.com/webstore/detail/iblenkmcolcdonmlfknbpbgjebabcoae',
            successCallback
, failureCallback);
       
}
       
When i click a button in website it's will call ExtInstall() function BUT i get an error: "uncaught Chrome Web Store installations can only be initated by a user gesture.". Can you tell me why i get this error? How can i fix it? 
Thanks!

Antony Sargent

unread,
Sep 9, 2015, 12:36:19 PM9/9/15
to Tuấn Trần, Chromium-extensions

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/1cd13501-5836-4a26-9ab8-ec0785f63875%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Message has been deleted

Tuấn Trần

unread,
Sep 11, 2015, 3:57:18 AM9/11/15
to Chromium-extensions, trananht...@gmail.com
Hi, thanks for reply! I have tried following this example but i get another error: "Uncaught Error: A Chrome Web Store installation is already pending". I have try in localhost website, is this problem? So, can you tell me other documnets, sample?

Vào 23:36:19 UTC+7 Thứ Tư, ngày 09 tháng 9 năm 2015, Antony Sargent đã viết:
On Wed, Sep 9, 2015 at 8:58 AM, Tuấn Trần <trananht...@gmail.com> wrote:
Hello, i have an extension and a website. I want to the user install my extension in my website, so i choose the way inline-installation to install my extension.
This is my code JS to add extension:
        function successCallback() {
            window
.alert('success');
       
}


       
function failureCallback() {
            window
.alert('failure');
       
}


       
       
function ExtInstall() {
           
if (chrome.app.isInstalled)
                alert
("already installed!");
           
else
                chrome
.webstore.install('https://chrome.google.com/webstore/detail/iblenkmcolcdonmlfknbpbgjebabcoae',
            successCallback
, failureCallback);
       
}
       
When i click a button in website it's will call ExtInstall() function BUT i get an error: "uncaught Chrome Web Store installations can only be initated by a user gesture.". Can you tell me why i get this error? How can i fix it? 
Thanks!

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.

Antony Sargent

unread,
Sep 11, 2015, 4:38:58 PM9/11/15
to Tuấn Trần, Chromium-extensions
It won't work from a localhost website, because it will fail the verified site requirement. 



On Fri, Sep 11, 2015 at 12:57 AM, Tuấn Trần <trananht...@gmail.com> wrote:
Hi, thanks for reply! I have tried following this example but i get another error: "Uncaught Error: A Chrome Web Store installation is already pending". I have try in localhost website, is this problem? So, can you tell me other documnets, sample?

Vào 23:36:19 UTC+7 Thứ Tư, ngày 09 tháng 9 năm 2015, Antony Sargent đã viết:
On Wed, Sep 9, 2015 at 8:58 AM, Tuấn Trần <trananht...@gmail.com> wrote:
Hello, i have an extension and a website. I want to the user install my extension in my website, so i choose the way inline-installation to install my extension.
This is my code JS to add extension:
        function successCallback() {
            window
.alert('success');
       
}


       
function failureCallback() {
            window
.alert('failure');
       
}


       
       
function ExtInstall() {
           
if (chrome.app.isInstalled)
                alert
("already installed!");
           
else
                chrome
.webstore.install('https://chrome.google.com/webstore/detail/iblenkmcolcdonmlfknbpbgjebabcoae',
            successCallback
, failureCallback);
       
}
       
When i click a button in website it's will call ExtInstall() function BUT i get an error: "uncaught Chrome Web Store installations can only be initated by a user gesture.". Can you tell me why i get this error? How can i fix it? 
Thanks!

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.

To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
Reply all
Reply to author
Forward
0 new messages