Skip to content

Commit

Permalink
improve and burn up 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lovemyliwu committed Dec 2, 2017
1 parent 78d5d66 commit 97c3e9b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
### 桑桑网页助手
### 桑桑网页助手

![demo](https://user-images.githubusercontent.com/2248369/33511264-9c32986c-d752-11e7-9eaa-4a1304d240a8.gif)
3 changes: 1 addition & 2 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ function getWeiboURL(params, type) {
}

async function captureScreenshotHandler(tab, results) {
chrome.debugger.detach({tabId: tab.id});
if (chrome.runtime.lastError) {
console.log(chrome.runtime.lastError.message);
return;
Expand Down Expand Up @@ -130,8 +131,6 @@ async function captureScreenshotHandler(tab, results) {
clipboard.select();
extension.document.execCommand('copy');
}

chrome.debugger.detach({tabId: tab.id});
}

function captureWeiBo(tab) {
Expand Down
11 changes: 6 additions & 5 deletions calculate_weibo_clip.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
var toSmallBtn = document.querySelector('[action-type="feed_list_media_toSmall"]');
var nav = document.querySelector('.WB_global_nav');
var msg = document.querySelector('#WB_webim');
var msg = document.querySelector('.webim_fold');
var fold = document.querySelector('.W_fold');
var panel = document.querySelector('.mini_panel_area');
var delay = 3000;

if (toSmallBtn)
toSmallBtn.click();

if (nav) {
nav.style.visibility = 'hidden';
setTimeout(() => {nav.style.visibility = 'visible';}, 2000);
setTimeout(() => {nav.style.visibility = 'visible';}, delay);
}

if (msg) {
msg.style.visibility = 'hidden';
setTimeout(() => {msg.style.visibility = 'visible';}, 2000);
setTimeout(() => {msg.style.visibility = 'visible';}, delay);
}

if (fold) {
fold.style.visibility = 'hidden';
setTimeout(() => {fold.style.visibility = 'visible';}, 2000);
setTimeout(() => {fold.style.visibility = 'visible';}, delay);
}

if (panel) {
panel.style.visibility = 'hidden';
setTimeout(() => {panel.style.visibility = 'visible';}, 2000);
setTimeout(() => {panel.style.visibility = 'visible';}, delay);
}

var detailClip = document.querySelector('.WB_feed_detail').getBoundingClientRect();
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "桑桑网页助手",
"version": "1.3",
"version": "1.3.1",
"description": "自动对微博截图,完整包含微博详情和转评赞数量",

"browser_action": {
Expand Down

0 comments on commit 97c3e9b

Please sign in to comment.