Chrome Webstore inline installation with AngularJS

后端 未结 2 1925
[愿得一人]
[愿得一人] 2021-01-22 00:40

I\'m a newbie with AngularJS and trying to install a Chrome extension following the Webstore inline installation guide

In my .html file

2条回答
  •  心在旅途
    2021-01-22 01:25

    chrome.webstore.install function accept 2 callback parameters, which means 2 pointers to function. You should not call those functions yourself, but just pass in their names, like this:

    chrome.webstore.install('https://chrome.google.com/webstore/detail/...',
            successCallback, failureCallback);
    

    Instead of this:

    chrome.webstore.install('https://chrome.google.com/webstore/detail/...',
            successCallback(), failureCallback());
    

    Do you see the difference ? If you don't, have a look on this page which explains it well (and there's also this on 7 common JavaScript mistakes)

提交回复
热议问题