• 请不要在回答技术问题时复制粘贴 AI 生成的内容
firhome
V2EX  ›  程序员

有做过 chrome 扩展的吗?请教个问题。

  •  
  •   firhome · May 8, 2020 · 2492 views
    This topic created in 2391 days ago, the information mentioned may be changed or developed.
    我知道右上角那个 icon 可以打开 popup.html

    请问这个 popup.html 只能通过用户点击打开吗?

    可不可以通过 js 触发打开呢?(比如点页面上的一个按钮,弹出 popup.html )


    (查了很多资料,好像没找到解决方案。)
    11 replies  •  2020-05-09 09:58:13 +08:00
    cokyhe
    cokyhe
    May 8, 2020
    1
    应该不行,安全沙箱估计不允许,
    在页面上插入一个固定在右上角的浮动不行吗?
    firhome
    firhome
    OP
    May 8, 2020
    2
    @cokyhe 我也是这么想的,我估计不行,就是想来问问,除了加浮层外, 有没有 什么奇淫巧技。
    zhw2590582
    zhw2590582
    May 8, 2020
    3
    不行,文档我看过很多遍,没有这个接口,但你可以在 icon 上提示他。
    firhome
    firhome
    OP
    May 8, 2020
    4
    @zhw2590582 好吧,感谢。我也是看了很多遍文档,都是 setXXXX.

    我打算弄个 canvas 抖动的 icon 来提醒了
    y4ZIZrCL74b9MYl6
    y4ZIZrCL74b9MYl6
    May 8, 2020
    5
    不行 必须用户主动操作 可以做个提醒 扩展可以调用系统系统
    y4ZIZrCL74b9MYl6
    y4ZIZrCL74b9MYl6
    May 8, 2020
    6
    调用系统的提醒
    y4ZIZrCL74b9MYl6
    y4ZIZrCL74b9MYl6
    May 8, 2020
    7
    @firhome 抖动的 icon 应该不行 只允许添加文字和背景颜色 而且有字符长度限制 我记得最多两个中文
    whypool
    whypool
    May 8, 2020
    8
    可以的,右键菜单
    或者注入到 html 里面
    但还是需要用户主动触发
    MrKou47
    MrKou47
    May 8, 2020 via iPhone
    9
    不可以,必须用户选择触发才行
    ming
    ming
    May 8, 2020
    10
    不可能自动打开,你要有这种能力,那就乱了套了,别说这个,你在 popup 里面现在用点儿 new Function() 现在都不行了,审核越来越严格
    firhome
    firhome
    OP
    May 9, 2020
    11
    @overflow99 我说的是 canvas 我看官方 demo 有动画的,试过了。可以用。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1210 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 61ms · UTC 17:45 · PVG 01:45 · LAX 09:45 · JFK 12:45
    ♥ Do have faith in what you're doing.