使用链接打开Chrome扩展程序作为弹出窗口 [英] Opening a Chrome extension as a pop-up using a link

查看:124
本文介绍了使用链接打开Chrome扩展程序作为弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的浏览器中安装了chrome扩展程序.当我单击菜单栏中的扩展程序图标时,扩展程序将按预期方式以浮动弹出窗口的形式打开.

I have a chrome extension installed in my browser. When I click the extension's icon in the menu bar the extension opens as a floating pop-up, as expected.

我想做的是通过链接/快捷方式/其他程序中的任何内容在Chrome中打开扩展程序.作为第一步,我尝试从命令行打开扩展,例如: chrome"chrome-extension://abcdefghijklmnopqrstuvwxyz/index.html"

What I am trying to do is to open the extension in Chrome via a link/shortcut/whatever from another program. As a first step I've tried opening the extension from the command line, ex: chrome "chrome-extension://abcdefghijklmnopqrstuvwxyz/index.html"

这有效,但是扩展名将以新选项卡打开,并占据整个浏览页面,而不仅仅是弹出窗口.有没有办法在任何打开的选项卡顶部将扩展作为弹出窗口打开?

This works but the extension opens as a new tab and takes up a full broswer page instead of a just being a pop-up. Is there a way to open the extension as a pop-up on top of any open tabs?

推荐答案

可悲的是,这是完全不可能的.

Sadly, it's completely impossible.

正在使用的API ,但它至少需要用户手势,而最大程度地显式调用扩展.

There is an API in the works, but it would require at a minimum a user gesture, at a maximum explicit invocation of the extension.

因此打开链接是不够的,本机消息也不够.

So opening a link would not be enough, nor would a Native Message be.

这篇关于使用链接打开Chrome扩展程序作为弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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