|
@@ -24,7 +24,12 @@ let systemInfo = {
|
|
|
let fixProfileTabAutoTimer = null;
|
|
|
|
|
|
|
|
|
+let pin_login = false
|
|
|
function twitterPinLogin() {
|
|
|
+ if(pin_login){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ pin_login = true
|
|
|
if (window.location.href == 'https://api.twitter.com/oauth/authorize') {
|
|
|
let code = document.querySelector('code')
|
|
|
|
|
@@ -784,6 +789,7 @@ function initParseCard() {
|
|
|
onChangePageMain(inTwitterNode)
|
|
|
changeQueueNum(1)
|
|
|
}
|
|
|
+ twitterPinLogin()
|
|
|
showNFTGroupIcon()
|
|
|
if (queue_num <= 0) {
|
|
|
return
|
|
@@ -821,7 +827,7 @@ export function init() {
|
|
|
}
|
|
|
inited = true
|
|
|
console.log('init')
|
|
|
-
|
|
|
+ twitterPinLogin()
|
|
|
getDiscordAuthCode();
|
|
|
appendPopupPage();
|
|
|
|
|
@@ -836,7 +842,7 @@ export function init() {
|
|
|
if (where) {
|
|
|
return
|
|
|
}
|
|
|
- twitterPinLogin();
|
|
|
+
|
|
|
if (window.location.host.includes('twitter.com')) {
|
|
|
showNFTCard()
|
|
|
showNFTGroupIcon()
|
|
@@ -1425,9 +1431,9 @@ const initGroupTip = () => {
|
|
|
let iframe_banner = document.querySelector('#denet_group_banner')
|
|
|
if (iframe_banner) {
|
|
|
if (twitterAccount != getQueryStringByUrl(iframe_banner.src, 'twitterAccount')) {
|
|
|
- iframe_banner.style.visibility = 'hidden'
|
|
|
- iframe_banner.style.height = '0px'
|
|
|
- iframe_banner.src = chrome.runtime.getURL(`/iframe/group-card.html?twitterAccount=${twitterAccount}`)
|
|
|
+ iframe_banner.style.display = 'none'
|
|
|
+ // iframe_banner.src = chrome.runtime.getURL(`/iframe/group-card.html?twitterAccount=${twitterAccount}`)
|
|
|
+ iframe_banner.contentWindow.postMessage({ actionType: 'SHOW_BANNER', twitterAccount }, '*');
|
|
|
}
|
|
|
return
|
|
|
}
|
|
@@ -1435,14 +1441,13 @@ const initGroupTip = () => {
|
|
|
let dom = document.querySelector('div[data-testid="ScrollSnap-SwipeableList"]').closest('nav')
|
|
|
let iframe = document.createElement('iframe')
|
|
|
iframe.id = 'denet_group_banner'
|
|
|
- iframe.style.cssText = 'border: medium none; visibility:hidden; width:100%; height:0px;'
|
|
|
-
|
|
|
+ iframe.style.cssText = 'border: medium none; display:none; width:100%; height:100px;'
|
|
|
iframe.src = chrome.runtime.getURL(`/iframe/group-card.html?twitterAccount=${twitterAccount}`)
|
|
|
-
|
|
|
+ // iframe.contentWindow.postMessage({ actionType: 'SHOW_BANNER', twitterAccount }, '*');
|
|
|
|
|
|
if (dom && !dom.parentNode.querySelector('iframe')) {
|
|
|
- dom.parentNode.insertBefore(iframe, dom)
|
|
|
- // .children[0].appendChild(iframe)
|
|
|
+ // dom.parentNode.insertBefore(iframe, dom)
|
|
|
+ dom.parentNode.children[0].appendChild(iframe)
|
|
|
}
|
|
|
|
|
|
} catch (error) {
|
|
@@ -1453,8 +1458,7 @@ const initGroupTip = () => {
|
|
|
|
|
|
export const showGroupTip = () => {
|
|
|
let dom_denet_group_banner = document.querySelector('#denet_group_banner')
|
|
|
- dom_denet_group_banner.style.visibility = 'visible';
|
|
|
- dom_denet_group_banner.style.height = '100px';
|
|
|
+ dom_denet_group_banner.style.display = 'block';
|
|
|
groupBtnStyleChange();
|
|
|
}
|
|
|
|