我开发了一个 Google 电子表格插件。我正在尝试在我的网站上添加内联安装选项。但是我的插件被添加为 Google Chrome 扩展程序,而不是普通的安装插件。
预期结果:在用户帐户上安装附加组件。以下是代码要点:
<html>
<head>
<title>Inline Installtion</title>
<link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/jjkkhnadaddgofdoapkbdemklgkcnmld">
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" />
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div class="section">
<div class="row">
<div class="col-sm-2">
<div class="">
<h5 class=""></h5>
</div>
</div><!-- left div/column -->
<div class="col-sm-8 form_div">
<br>
<br>
<br>
<br>
<div class="form-group main_button">
<div class="col-lg-10 col-lg-offset-2">
<div class="col-lg-4"></div>
<div class="col-lg-4">
<button type="submit" class="btn btn-primary" id="install-button">Add to Chrome</button>
</div>
<div class="col-lg-4"></div>
</div>
</div>
</div>
<div class="col-sm-2">
<div class="">
<h5 class="center"></h5>
</div>
</div><!-- right div/column -->
</div><!-- row -->
</div><!-- section -->
</div><!-- container -->
<script>
$(document).ready(function() {
function successCallback(e)
{
console.log("Success");
console.log(e);
}
function failureCallback(e)
{
console.log("Failure");
console.log(e);
}
$("#install-button").click(function(event) {
chrome.webstore.install("https://chrome.google.com/webstore/detail/jjkkhnadaddgofdoapkbdemklgkcnmld", successCallback, failureCallback);
});
});
</script>
</body>
</html>
所以我的问题是:有可能做到吗?如果是,如何启用 Google 电子表格插件的内联安装?
非常感谢您的帮助。谢谢你。