尝试用setInterval及chrome.tabs.query的方法解决初次访问Mis时的卡顿问题,但失败了

This commit is contained in:
free will
2020-10-09 19:53:37 +08:00
parent 49e27d13ae
commit 16252680ae
2 changed files with 14 additions and 2 deletions
+13 -1
View File
@@ -15,6 +15,8 @@ var misPrefixNum=0;
var interestLifetimeMilliseconds=2000;
// 是否开启mis更新映射表
var misEnableState=true;
// 全局变量,用于设置是否刷新当前active的界面
// var myInterval=null;
// min协议的URI协议头
var minProtocolHeader="min/";
@@ -144,6 +146,17 @@ function addCustomRule(editingRule) {
}
}
// 刷新正在浏览的浏览器界面
function refreshActiveTab () {
chrome.tabs.query({active: true}, function(tabs) {
var tabIndex = tabs[0].index;
chrome.tabs.query({}, function(tabs) {
chrome.tabs.reload(tabs[tabIndex].id);
})
});
console.log("refresh########");
}
function express(prefixUri) {
// alert("成功加载mis的IP: "+misHost+"; misPrefix: "+misPrefix);
// Connect to the forwarder with a WebSocket.
@@ -184,7 +197,6 @@ function express(prefixUri) {
}else{
// mis没有该前缀对应的映射
}
// alert("really begin 4");
}, onTimeout);
}
+1 -1
View File
@@ -3,7 +3,7 @@
"manifest_version": 2,
"name": "__MSG_extensionName__",
"version": "1.3.17",
"homepage_url": "https://github.com/",
"homepage_url": "https://gitee.com/",
"icons": {
"20": "static/images/r20.png",
"25": "static/images/r25.png",