Chrome扩展程序:page_action的行为与browser_action类似(未在地址栏中显示) [英] Chrome extension: page_action behaves like browser_action (not showing in address bar)

查看:507
本文介绍了Chrome扩展程序:page_action的行为与browser_action类似(未在地址栏中显示)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个Chrome扩展程序:



自两周以来<并且没有吃过g对扩展程序进行了任何更改或更新),图标现在总是出现在地址栏旁边的图标栏中,而不再位于地址栏中,就好像它将被声明为 browser_action ,但它不是!



p>

也许这是由于Chrome更新引起的,我使用的是最新版本49.0.2623.87。我已经卸载并重新安装了扩展程序,没有任何更改。



Google是否更改了页面操作的行为?有人知道吗?如何将图标放回地址栏?



我还发现令人困惑的是


Google最近改变了页面行动起作用,文件
还没有真正赶上。以前,页面操作出现在
地址栏中,并且只出现在您打过show的标签上。


来自Marc Guiselin的有用链接也阐明了这一点: http://thenextweb.com/apps/2016/03/04/google-chrome-bans-extensions-from-the-address-bar-forcing-them to-the-side /


I have written a Chrome extension: https://chrome.google.com/webstore/detail/commentanywhereorg/popgjmfoablgkolkhmnicijimhpifega that has a "page_action" (and not a browser action!) in it's manifest.

I had loaded the extension into the Chrome store beginning of February and the icon always appeared in the address bar of Chrome, next to the bookmark/favorite star icon, as planned:

Since two weeks or so (and without having made any changes or update to the extension), the icon now always appears in the icon bar right next to the address bar, and not in the address bar anymore, as if it would be declared as a "browser_action", but it's not!

Maybe it's due to a Chrome update, I'm on the latest version 49.0.2623.87. I already uninstalled and re-installed the extension, without any change.

Did Google change the behaviour of page actions? Does anyone know? How to get the icon back into the address bar?

What I also find confusing is the documentation on https://developer.chrome.com/extensions/pageAction:

Use the chrome.pageAction API to put icons inside the address bar. Page actions represent actions that can be taken on the current page, but that aren't applicable to all pages.

but their screenshots shows the icon outside of the address bar (in their example, the RSS icon):

My extension manifest looks like this:

{
  "manifest_version": 2,
  "name": "CommentAnywhere.org",
  "description": "CommentAnywhere.org allows you to comment anywhere on the web using your Facebook account.",
  "icons": {
     "128": "icon_128x128.png",
     "48": "icon_48x48.png",
     "32": "icon_32x32.png",
     "16": "icon_16x16.png"
  },
  "version": "1.4.1",
  "page_action": {
    "default_icon": "icon_32x32.png",
    "default_title": "CommentAnywhere.org",
    "default_popup": "popup.html"
  },

  "background": {
    "scripts": ["background.js"]
  },
  "permissions": [
    "activeTab"
  ]
}

解决方案

I just found the answer in another SO topic - with a different headline though - therefore missed it in the first place. Thanks to user Teepeemm.

Popup is not appearing when used page_action

Google recently changed how page actions work, and the documentation hasn't really caught up. Previously, page actions appeared in the address bar, and only appeared on tabs where you had called show.

And a helpful link from Marc Guiselin clarifies it as well: http://thenextweb.com/apps/2016/03/04/google-chrome-bans-extensions-from-the-address-bar-forcing-them-to-the-side/

这篇关于Chrome扩展程序:page_action的行为与browser_action类似(未在地址栏中显示)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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