Comments (1)
目前是监听OnUpdatedChangeInfoType事件,也就是新开tab的事件内容,文档在这里 https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/onUpdated
When the user navigates to a new URL in a tab, this typically generates several onUpdated events as various properties of the tabs.Tab object are updated. This includes the url, but also potentially the title and favIconUrl properties. The status property will cycle through "loading" and "complete".
解决方法:插件开启,或者暂停时间到了以后,有个setTimoutOut方法,来iterate所有的tab,检测url匹配后关闭。
var tabs = await chrome.tabs.query({});
tabs.forEach(function (tab) {
// do whatever you want with the tab
});
我个人认为这个需求比较小众吧,没必要监听当前页面,暂停(放松)过后,关闭抖音就行,开始工作,自动关闭不是太友好,万一再看关键内容呢,也意义不大。以后有相似需求我会加上。
from chrome-url-block.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chrome-url-block.