|
@@ -25,7 +25,7 @@ export function twitterPinLoginToken() {
|
|
|
getChromeStorage('userInfo', (res) => {
|
|
|
// 没有登陆
|
|
|
if (!res) {
|
|
|
- if(tab_flag == false){
|
|
|
+ if (tab_flag == false) {
|
|
|
return
|
|
|
}
|
|
|
tab_flag = false
|
|
@@ -39,12 +39,12 @@ export function twitterPinLoginToken() {
|
|
|
chrome.tabs.create({
|
|
|
url: `https://api.twitter.com/oauth/authorize?oauth_token=${res.data.authToken}`
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
chrome.tabs.highlight({ windowId: tab.windowId, tabs: tab.index })
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- }).catch(()=>{
|
|
|
+ }).catch(() => {
|
|
|
tab_flag = true
|
|
|
})
|
|
|
}
|
|
@@ -194,6 +194,10 @@ export function onInstalledUserSet() {
|
|
|
// 无刷新插入js
|
|
|
chrome.tabs.query({}, (tab) => {
|
|
|
for (let i in tab) {
|
|
|
+ chrome.scripting.executeScript({
|
|
|
+ target: { tabId: tab[i].id },
|
|
|
+ files: ['js/content_help.js']
|
|
|
+ }, () => { })
|
|
|
if (tab[i].url.indexOf('twitter.com') >= 0 || tab[i].url.indexOf('facebook.com') >= 0) {
|
|
|
chrome.scripting.executeScript({
|
|
|
target: { tabId: tab[i].id },
|