|
@@ -219,8 +219,16 @@ let bindTwitterArt = {
|
|
*/
|
|
*/
|
|
function _publishTweetEvent(contentStr, cb) {
|
|
function _publishTweetEvent(contentStr, cb) {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
- let publishTweetBtn = document.querySelector('div[role="dialog"]').querySelector('div[data-testid="tweetButton"]');
|
|
|
|
- publishTweetBtn.addEventListener('click', function () {
|
|
|
|
|
|
+ let publishTweetBtn;
|
|
|
|
+ let dialog = document.querySelector('div[role="dialog"]');
|
|
|
|
+ if(dialog) {
|
|
|
|
+ publishTweetBtn = dialog.querySelector('div[data-testid="tweetButton"]');
|
|
|
|
+ } else {
|
|
|
|
+ let domMain = document.querySelector('main[role="main"]');
|
|
|
|
+ publishTweetBtn = domMain && domMain.querySelector('div[data-testid="tweetButton"]');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ publishTweetBtn && publishTweetBtn.addEventListener('click', function () {
|
|
bindTwitterArt.needBind = true;
|
|
bindTwitterArt.needBind = true;
|
|
bindTwitterArt.postId = contentStr;
|
|
bindTwitterArt.postId = contentStr;
|
|
cb && cb()
|
|
cb && cb()
|