|
@@ -64,7 +64,7 @@ function getDiscordAuthCode() {
|
|
|
* @param port
|
|
|
*/
|
|
|
function renderDom() {
|
|
|
- if (window.location.href.indexOf('https://twitter.com') > -1) {
|
|
|
+ if (window.location.href.indexOf('https://twitter.com') > -1 || window.location.href.indexOf('https://mobile.twitter.com') > -1 ) {
|
|
|
_createBtnDom();
|
|
|
onWindowResize();
|
|
|
checkHasDeBtn();
|
|
@@ -1245,13 +1245,35 @@ function onReplyDialogOpen(params, iframe) {
|
|
|
businessType: Report.businessType.buttonClick,
|
|
|
objectType: Report.objectType.replyClickByTwitterList
|
|
|
});
|
|
|
+ let editDom = dialog.querySelector('div[contenteditable="true"]');
|
|
|
+ let eleList = []
|
|
|
+ if(editDom) {
|
|
|
+ eleList = editDom.querySelectorAll('span[data-text="true"]');
|
|
|
+ } else {
|
|
|
+ // mobile.twitter.com
|
|
|
+ editDom = dialog.querySelector('textarea');
|
|
|
+ if(editDom) {
|
|
|
+ let value = editDom.value;
|
|
|
+ if(value) {
|
|
|
+ let strArr = value.split(' ');
|
|
|
+ if(strArr && strArr.length) {
|
|
|
+ for(let i = 0; i < strArr.length; i++) {
|
|
|
+ eleList.push({
|
|
|
+ innerText: strArr[i]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- let eleList = dialog.querySelector('div[contenteditable="true"]').querySelectorAll('span[data-text="true"]');
|
|
|
- reportReplyResult(eleList, params, () => {
|
|
|
+ if(eleList.length) {
|
|
|
+ reportReplyResult(eleList, params, () => {
|
|
|
// 上報完成
|
|
|
iframe.contentWindow.postMessage({ actionType: 'CONTENT_RED_PACKET_REPLY_RASK_FINSH', data: { postId: params.postId } }, '*');
|
|
|
// chrome.runtime.sendMessage({ actionType: "CONTENT_RED_PACKET_REPLY_RASK_FINSH", data: { postId: params.postId } }, () => { })
|
|
|
- })
|
|
|
+ })
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
}, 1000);
|