chrome.runtime chrome.tabs 是 Chrome 扩展开发中两个不同的 API,它们各自有不同的用途和功能。

chrome.runtime

  1. 全局上下文 chrome.runtime 主要用于处理扩展的全局上下文,如背景脚本、弹出窗口等。

  2. 消息传递 :它提供了在扩展的不同组件(如内容脚本、背景脚本、弹出窗口等)之间进行消息传递的方法,例如 chrome.runtime.sendMessage chrome.runtime.onMessage.addListener

  3. 生命周期事件 :你可以监听扩展的各种生命周期事件,如安装、更新、卸载等。

  4. 获取扩展信息 :你可以使用 chrome.runtime.getManifest() 来获取扩展的 manifest.json 文件中的信息。

  5. 错误处理 chrome.runtime.lastError 可用于检查上一个 API 调用是否有错误。

chrome.tabs

  1. 标签操作 chrome.tabs 主要用于操作浏览器标签。你可以创建、更新、移动、关闭标签等。

  2. 标签查询 :你可以使用 chrome.tabs.query 来查找符合特定条件的标签。

  3. 消息传递 :与 chrome.runtime.sendMessage 不同, chrome.tabs.sendMessage 允许你向特定标签的内容脚本发送消息。

  4. 脚本注入 :你可以使用 chrome.tabs.executeScript 来在特定标签上执行脚本。

  5. 获取当前标签 :你可以使用 chrome.tabs.getCurrent chrome.tabs.query 来获取当前活动标签的信息。

  6. 标签事件 :你可以监听各种与标签相关的事件,如标签创建、更新、激活、移动等。

总体来说, chrome.runtime 主要用于处理扩展的全局逻辑和生命周期,而 chrome.tabs 主要用于操作和管理浏览器标签。两者都有消息传递的功能,但用途和适用场景有所不同。

vue- tabs - chrome 一个类似于 Chrome 的标签的Vue组件。 Draggabilly由@desandro提供的拖放支持。 现场演示https://viewweiwu.github.i vue- tabs - chrome 一个类似于 Chrome 的标签的Vue组件。 Draggabilly由@desandro提供的拖放支持。 现场演示https://viewweiwu.github.io/vue- tabs - chrome /安装npm install --save vue- tabs - chrome 用法 我花了将近一个多月的时间断断续续写下这篇博文,并精心写下完整demo,写博客的辛苦大家懂的,所以转载务必保留出处。本文所有涉及到的大部分代码均在这个demo里面:https://github.com/sxei/ chrome -plugin-demo ,大家可以直接下载下来运行。 另外,本文图片较多,且图片服务器带宽有限,右下角的目录滚动监听必须等到图片全部加载完毕之后才会触发,所以请耐心等...
引用: https://blog.csdn.net/qq_34906385/article/details/93524163 app:tabIndicatorColor :指示线的颜色 app:tabIndicatorHeight : 指示线的高度 app:tabIndicatorFullWidth=false 指示线是否铺满宽度 app: tabS electedTextColor : tab选中时的字体颜色 app:tabTextColor=@color/colorPrimary :未选中字体颜色 app:tabBackground=color : 整个tablayout颜色
"A number of fixes and improvements."[r 149] Support for ResizeObservers, will notify you when an element’s content rectangle has changed its size. Modules can now access to host specific metadata with import.meta. The pop-up blocker gets stronger. window.alert() no longer changes tab focus. Chrome now supports named captures in regular expressions. The default preload value for <audio> and <video> elements is now metadata. You can now use Request.prototype.cache to view the cache mode of a Request and determine whether a request is a reload request. Using the Focus Management API, you can now focus an element without scrolling to it with the preventScroll attribute.[r 150] Extensions page generates packages in CRX3 format now.[r 151] Android version: Prevents sites with abusive ad experiences from opening new windows or tabs without your permission. "Stability and performance improvements."[r 152]
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.al