[英]Close Chrome extension with button
I am trying to close a chrome extension on-click of a button. 我试图在单击按钮时关闭Chrome扩展程序。 The window is the only window open for this app.
该窗口是为此应用打开的唯一窗口。 I thought the below would work but receiving the following console errors.
我以为以下方法可以工作,但是收到以下控制台错误。
I am referencing jQuery in my HTML. 我在HTML中引用jQuery。 All I want it to click a button and close my chrome app.
我只需要单击一个按钮并关闭我的Chrome应用即可。
Uncaught TypeError: Cannot read property 'current' of undefined
未捕获的TypeError:无法读取未定义的属性“当前”
$(document).ready(function() {
$("#close").click(function() {
chrome.app.window.current().close();
});
});
The duplicate in no way explains my issue 重复绝不能解释我的问题
从窗口尝试:
window.close();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.