通过代码删除Chrome扩展程序 [英] Remove Chrome extension via code

查看:177
本文介绍了通过代码删除Chrome扩展程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个Chrome应用程序。当用户将其添加到Chrome浏览器时,表单将作为安装的一部分打开。如果安装不正确,我想删除添加的扩展名。

I have created a Chrome application. When the user adds it to the Chrome browser, a form is opened as a part of the installation. I want to delete the added extension when the installation is not done correctly.

如何触发删除Chrome扩展程序?

How do I trigger deletion of a Chrome extension?

推荐答案

扩展可以通过调用 chrome.management.uninstallSelf();

An extension can remove itself by calling chrome.management.uninstallSelf();.

如果您的扩展名想删除另一个扩展,声明 管理清单文件中的权限并调用 chrome.management.uninstall( '<其他扩展程序>');

If your extension wants to remove another extension, declare the management permission in the manifest file and call chrome.management.uninstall('<id of other extension>');.

您不能从命令行卸载扩展程序的Chrome 36.0.1960.0(使用 - uninstall-extension crbug 351294 )。

You cannot uninstall an extension from the command line any more as of Chrome 36.0.1960.0 (using --uninstall-extension, crbug 351294).

这篇关于通过代码删除Chrome扩展程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆