|
@@ -70,7 +70,7 @@ class ParseCard {
|
|
|
a_arr = Array.from(a_arr).reverse()
|
|
|
for (let i in a_arr) {
|
|
|
|
|
|
- if (a_arr[i].href.indexOf('facebook.com') > 0) {
|
|
|
+ if (a_arr[i].href.indexOf('facebook.com') > 0 && a_arr[i].href.indexOf('denetme') > 0) {
|
|
|
let faceUrl = new URL(a_arr[i].href);
|
|
|
let faceSearch = new URLSearchParams(faceUrl.search);
|
|
|
let faceJumpUrl = decodeURIComponent(faceSearch.get('u'));
|
|
@@ -132,7 +132,7 @@ class ParseCard {
|
|
|
let json_data = []
|
|
|
this.parseFaceBookCard().forEach((item) => {
|
|
|
let _obj = this.parseFaceBookParmas(item.dom)
|
|
|
- if (_obj.tweet_Id && _obj.short_url && _obj.dom_card) {
|
|
|
+ if (_obj.short_url && _obj.dom_card) {
|
|
|
_obj.time = item.time
|
|
|
json_data.push(_obj)
|
|
|
}
|
|
@@ -194,10 +194,14 @@ class ParseCard {
|
|
|
return _array
|
|
|
}
|
|
|
|
|
|
- createIframe({ post_Id, tweet_Id, tweet_author }, if_center = false) {
|
|
|
+ createIframe({ post_Id = '', tweet_Id = '', tweet_author = '' }, if_center = false) {
|
|
|
let _iframe = document.createElement('iframe')
|
|
|
+ let tweet_str = '';
|
|
|
+ if (tweet_Id) {
|
|
|
+ tweet_str = `&tweetId=${tweet_Id}`;
|
|
|
+ }
|
|
|
_iframe.id = post_Id
|
|
|
- _iframe.src = chrome.runtime.getURL('/iframe/red-packet.html') + `?postId=${post_Id}&tweetId=${tweet_Id}&tweet_author=${tweet_author}&window_origin=${window.location.origin}`;
|
|
|
+ _iframe.src = chrome.runtime.getURL('/iframe/red-packet.html') + `?postId=${post_Id}${tweet_str}&tweet_author=${tweet_author}&window_origin=${window.location.origin}`;
|
|
|
_iframe.style.cssText = 'border:medium none; width:375px; min-height:500px;'
|
|
|
if (if_center) {
|
|
|
_iframe.style.cssText = 'border:medium none; width:375px; min-height:500px; display:block; margin:auto;'
|
|
@@ -320,7 +324,7 @@ class ParseCard {
|
|
|
let originUrl = new URL(short_url);
|
|
|
let post_Id = originUrl.pathname.slice(1);
|
|
|
|
|
|
- dom.appendChild(this.createIframe({ post_Id, tweet_Id, tweet_author }, true))
|
|
|
+ dom.appendChild(this.createIframe({ post_Id, tweet_author }, true))
|
|
|
}
|
|
|
}
|
|
|
}
|