|
@@ -680,10 +680,21 @@ function createTweetToolbarToolBox() {
|
|
|
function addSliderNavDeBtn() {
|
|
|
try {
|
|
|
let isSmall = false;
|
|
|
+ let isFloating = false;
|
|
|
+ let floatingTweetBtn;
|
|
|
let tweetBtn = document.querySelector('a[data-testid="SideNav_NewTweet_Button"]');
|
|
|
- if (tweetBtn && tweetBtn.querySelector('svg')) {
|
|
|
- isSmall = true;
|
|
|
+ if (tweetBtn) {
|
|
|
+ if(tweetBtn.querySelector('svg')) {
|
|
|
+ isSmall = true;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 手机打开twitter 发推按钮
|
|
|
+ floatingTweetBtn = document.querySelector('div[data-testid="FloatingActionButtonBase"]');
|
|
|
+ if(floatingTweetBtn) {
|
|
|
+ isFloating = true;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
if (!isSmall) {
|
|
|
let bigDom = document.querySelector('a[href="/compose/tweet"]').parentNode.parentNode;
|
|
|
let deBtn = document.getElementById('de-btn');
|
|
@@ -696,15 +707,19 @@ function addSliderNavDeBtn() {
|
|
|
});
|
|
|
}
|
|
|
} else {
|
|
|
- let smallDom = document.querySelector('a[href="/compose/tweet"]').parentNode.parentNode;
|
|
|
let deBtn3 = document.getElementById('de-btn3');
|
|
|
- if (smallDom && !deBtn3) {
|
|
|
- dom && dom.deBtn3 && smallDom.appendChild(dom.deBtn3);
|
|
|
- Report.reportLog({
|
|
|
- pageSource: Report.pageSource.mainPage,
|
|
|
- businessType: Report.businessType.buttonView,
|
|
|
- objectType: Report.objectType.buttonMain
|
|
|
- });
|
|
|
+ if(isFloating && !deBtn3) {
|
|
|
+ floatingTweetBtn.appendChild(dom.deBtn3);
|
|
|
+ } else {
|
|
|
+ let smallDom = document.querySelector('a[href="/compose/tweet"]').parentNode.parentNode;
|
|
|
+ if (smallDom && !deBtn3) {
|
|
|
+ dom && dom.deBtn3 && smallDom.appendChild(dom.deBtn3);
|
|
|
+ Report.reportLog({
|
|
|
+ pageSource: Report.pageSource.mainPage,
|
|
|
+ businessType: Report.businessType.buttonView,
|
|
|
+ objectType: Report.objectType.buttonMain
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} catch (e) {
|