Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/algorithm/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将弹出窗格添加到crossrider加载项图标,并将闪烁图标添加到加载项图标_Crossrider - Fatal编程技术网

将弹出窗格添加到crossrider加载项图标,并将闪烁图标添加到加载项图标

将弹出窗格添加到crossrider加载项图标,并将闪烁图标添加到加载项图标,crossrider,Crossrider,我想将我现有的firefox和chrome插件迁移到crossrider,以便将其与safari和IE一起使用,但我怀疑mayble Schlomo(或任何crossrider开发者)能否帮助我解决这些问题 问题: 当有人单击显示其中某些选项的加载项按钮时,我可以添加一个弹出窗格吗 我可以在实际图标上添加一个闪烁的图标来显示发生的事件,比如聊天之类的吗 有没有办法在图标右下角添加类似于chrome的红色文本框 非常感谢 当你提出这样的问题时,我只希望下面的回答能减轻你的疑虑并给你启发:) 首先,

我想将我现有的firefox和chrome插件迁移到crossrider,以便将其与safari和IE一起使用,但我怀疑mayble Schlomo(或任何crossrider开发者)能否帮助我解决这些问题

问题:

  • 当有人单击显示其中某些选项的加载项按钮时,我可以添加一个弹出窗格吗

  • 我可以在实际图标上添加一个闪烁的图标来显示发生的事件,比如聊天之类的吗

  • 有没有办法在图标右下角添加类似于chrome的红色文本框


  • 非常感谢

    当你提出这样的问题时,我只希望下面的回答能减轻你的疑虑并给你启发:)

    首先,我建议您熟悉一般情况和具体情况

    在回答您的具体问题时:

  • 您可以使用按钮弹出功能,并在其中构建所需的选项。看一下演示扩展,让您开始
  • 虽然不能使按钮闪烁,但可以交替使用按钮图标使其看起来像在闪烁(参见示例)
  • 简言之,是的。只需使用和方法(参见示例)
  • 下面的示例汇集了background.js代码中实现上述解决方案所需的关键元素。查看按钮弹出菜单中的popup.html文件,了解如何构建选项页面的示例

    appAPI.ready(function() {
        var sid, // Blink interval id
            alt=0, // Blink alternation state
            icon = { // Blink icons
                0: 'icons/icon0.png',
                1: 'icons/icon1.png'
            };
    
        // Set the initial icon for the button
        appAPI.browserAction.setResourceIcon(icon[0]);
        // Sets the popup for the button
        appAPI.browserAction.setPopup({
            resourcePath:'html/popup.html',
            height: 300,
            width: 300
        });
    
        if (true) { // blink condition, set to true for this example
            // Blink icon
            sid = appAPI.setInterval(function() {
                alt = 1 - alt;
                appAPI.browserAction.setResourceIcon(icon[alt]);
            }, 1 * 1000);
        } else {
            appAPI.clearInterval(sid);
        }
    
        if (true) { // show button text condition, set to true for this example
            // Add red text box to icon
            appAPI.browserAction.setBadgeText('ext', [255,0,0,255]);
        }
    });
    
    [披露:我是一名交叉骑手员工]