zoukankan      html  css  js  c++  java
  • Chrome浏览器扩展开发系列之五:Page Action类型的Chrome浏览器扩展

    Page Action类型的Google Chrome浏览器扩展程序,通常也会有一个图标,但这个图标位于Chrome浏览器的地址栏内右端。而且这个图标并非始终出现,而是当某指定的页面打开时才会出现。也就是说,这个图标与当前打开的页面有关,只有打开了指定的页面才会显示该图标,对该页面执行对应的操作。

    定义Page Action类型的Google Chrome扩展程序,首先要在manifest.json文件中注册如下:

    {
            ...
            "page_action": {
              "default_icon": {                    // optional
                "19": "images/icon19.png",           // optional
                "38": "images/icon38.png"            // optional
              },
              "default_title": "Google Mail",      // optional; shown in tooltip
              "default_popup": "popup.html"        // optional
            },
            ...
          }

    对于Page Action类型的Google Chrome扩展程序,其图标、提示、弹出框都类似于Browser Action。

    Page Action没有徽章,但是有显示或隐藏的变化。默认Page Action是隐藏的,必须指定打开什么样的tab时显示Page Action的图标。

    控制Page Action的图标显示使用chrome.pageAction.show(integer tabId)方法。

    控制Page Action的图标隐藏使用chrome.pageAction.hide(integer tabId)方法。

    点击Page Action的图标绑定事件使用chrome.pageAction.onClicked.addListener(function (tab) {…})方法。

  • 相关阅读:
    [C#] XmlDocument 搭配 Linq 與 XPath
    使用 Visual C# .NET 通过 XPath 表达式查询 XML
    Using the Contact Selector Control
    初学jquery之自学笔记(4)
    微软所有的sdk
    Sharepoint 2010 sdk
    Open your rolodex from InfoPath using the Contact Selector
    纯粹B/S方式实现InfoPath的设计和运行时Web Builder [转载]
    ExtJs之Ext.data.Store
    创建可绑定到 InfoPath 表单数据的 ActiveX 控件
  • 原文地址:https://www.cnblogs.com/h2zZhou/p/7250386.html
Copyright © 2011-2022 走看看