|  | @@ -2,7 +2,6 @@ import { fetchTtwitterRequestToken, fetchTwitterLogin, fetchTwitterShortUrl, fet
 | 
	
		
			
				|  |  |  import { LANDING_PAGE, LANDING_PAGE_MID, setChromeStorage, setChromeCookie, getChromeCookie, getChromeStorage, removeChromeCookie } from '@/uilts/chromeExtension.js'
 | 
	
		
			
				|  |  |  import { guid } from '@/uilts/help.js'
 | 
	
		
			
				|  |  |  import { pageUrl, discordAuthRedirectUri } from '@/http/configAPI'
 | 
	
		
			
				|  |  | -import { trueDependencies } from 'mathjs'
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  let authToken = ''
 | 
	
		
			
				|  |  |  let consumerKey = ''
 | 
	
	
		
			
				|  | @@ -26,7 +25,7 @@ export function twitterPinLoginToken() {
 | 
	
		
			
				|  |  |      getChromeStorage('userInfo', (res) => {
 | 
	
		
			
				|  |  |          // 没有登陆
 | 
	
		
			
				|  |  |          if (!res) {
 | 
	
		
			
				|  |  | -            if(tab_flag == false){
 | 
	
		
			
				|  |  | +            if (tab_flag == false) {
 | 
	
		
			
				|  |  |                  return
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              tab_flag = false
 | 
	
	
		
			
				|  | @@ -40,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
 | 
	
		
			
				|  |  |              })
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -195,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 },
 | 
	
	
		
			
				|  | @@ -306,13 +309,7 @@ function createAlarm() {
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      //每次加載就清空定時器
 | 
	
		
			
				|  |  | -    chrome.alarms.clearAll();
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    chrome.alarms.onAlarm.addListener(function (alarm) {
 | 
	
		
			
				|  |  | -        console.log("onAlarm-", alarm);
 | 
	
		
			
				|  |  | -        getMessageInfo();
 | 
	
		
			
				|  |  | -    });
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +    chrome.alarms.clear('denetChromeAlarm');
 | 
	
		
			
				|  |  |      //創造定時器
 | 
	
		
			
				|  |  |      chrome.alarms.create('denetChromeAlarm', alarmInfo);
 | 
	
		
			
				|  |  |  }
 |