|
@@ -114,7 +114,8 @@ export function showTwitterPublishDialogHandler(publishRes) {
|
|
|
addPublishTipsIframe({
|
|
|
srcContent: publishRes.copyContent
|
|
|
})
|
|
|
- _setPublishContent(publishRes.srcContent);
|
|
|
+ // _setPublishContent(publishRes.srcContent);
|
|
|
+ setDialogPublishContent(publishRes.srcContent);
|
|
|
_publishTweetEvent(publishRes, bindTwitterArtMethod);
|
|
|
}
|
|
|
|
|
@@ -480,6 +481,22 @@ export const _setPublishContent = throttle(function (content, time = 1000) {
|
|
|
}
|
|
|
}, 800);
|
|
|
|
|
|
+
|
|
|
+const setDialogPublishContent = throttle(function (content) {
|
|
|
+ setTimeout(() => {
|
|
|
+ let inputEle = document.querySelector('div[role="dialog"]').querySelector('div[contenteditable="true"]');
|
|
|
+ const dataTransfer = new DataTransfer();
|
|
|
+ dataTransfer.setData('text', content);
|
|
|
+ const event = new ClipboardEvent('paste', {
|
|
|
+ clipboardData: dataTransfer,
|
|
|
+ bubbles: true
|
|
|
+ });
|
|
|
+ if(inputEle) {
|
|
|
+ inputEle.dispatchEvent(event);
|
|
|
+ }
|
|
|
+ }, 300)
|
|
|
+}, 600);
|
|
|
+
|
|
|
/**
|
|
|
* 创建deNet按钮 添加到页面
|
|
|
* @returns {{deBtn2: HTMLDivElement, deBtn1: HTMLDivElement, deBtn: HTMLSpanElement}}
|
|
@@ -1571,7 +1588,7 @@ export const appendPopupPage = (params = {}) => {
|
|
|
let iframe = document.createElement('iframe');
|
|
|
iframe.id = 'de-popup-page';
|
|
|
iframe.src = chrome.runtime.getURL('/iframe/popup-page.html') + `#${path}`;
|
|
|
- iframe.style.cssText = `border: medium none; width: 375px;
|
|
|
+ iframe.style.cssText = `border: medium none; width: 375px !important;
|
|
|
height: 650px;position: fixed; right: 16px; top: 16px;background: #FFFFFF;border: 0.5px solid #919191;box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.2);box-sizing: border-box;z-index: 90000;
|
|
|
animation-duration: 0.5s !important;
|
|
|
animation-timing-function: ease-in-out !important;
|