Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
zimocode committed Feb 20, 2020
2 parents 295a9fc + 9829e69 commit 53bd41a
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 194 deletions.
7 changes: 7 additions & 0 deletions change.log
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"log": [
{
"ver":"6.6.262.1048",
"date":"2020.02.18",
"content":[
"fix bugs: error if there's no sub for rss, issues@github: #85"
]
},
{
"ver":"6.6.260.1045",
"date":"2020.02.16",
Expand Down
37 changes: 19 additions & 18 deletions js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -1661,7 +1661,7 @@ var sub={
clipOBJ.remove();
})
}
var thepers=["clipboardRead"];
var thepers=["clipboardWrite"];
var theorgs;
sub.checkPermission(thepers,theorgs,theFunction);
},
Expand Down Expand Up @@ -1774,7 +1774,7 @@ var sub={
document.execCommand('copy');
clipOBJ.remove();
}
var thepers=["clipboardRead"];
var thepers=["clipboardWrite"];
var theorgs;
sub.checkPermission(thepers,theorgs,theFunction);
},
Expand Down Expand Up @@ -1897,7 +1897,7 @@ var sub={
document.execCommand('copy');
clipOBJ.remove();
}
var thepers=["clipboardRead"];
var thepers=["clipboardWrite"];
var theorgs;
sub.checkPermission(thepers,theorgs,theFunction);
},
Expand All @@ -1910,7 +1910,7 @@ var sub={
document.execCommand('copy');
clipOBJ.remove();
}
var thepers=["clipboardRead"];
var thepers=["clipboardWrite"];
var theorgs;
sub.checkPermission(thepers,theorgs,theFunction);
},
Expand All @@ -1923,7 +1923,7 @@ var sub={
document.execCommand('copy');
clipOBJ.remove();
}
var thepers=["clipboardRead"];
var thepers=["clipboardWrite"];
var theorgs;
sub.checkPermission(thepers,theorgs,theFunction);
},
Expand Down Expand Up @@ -1989,7 +1989,7 @@ var sub={
clipOBJ.remove();
}

var thepers=["clipboardRead"];
var thepers=["clipboardWrite"];
var theorgs;
sub.checkPermission(thepers,theorgs,theFunction);
},
Expand All @@ -2001,7 +2001,7 @@ var sub={
.then(buffer => chrome.clipboard.setImageData(buffer,(sub.message.selEle.img.substr(sub.message.selEle.img.length-4)==".jpg"?"jpeg":"png")))
}

let thepers=["clipboardRead"],theorgs;
let thepers=["clipboardWrite"],theorgs;
sub.checkPermission(thepers,theorgs,theFunction);
},
imgsearch:function(){
Expand Down Expand Up @@ -3771,18 +3771,19 @@ var sub={
sub.theConf=getConf();
sub.theConf.type="action";
if(sub.theConf.name=="paste"){//for action paste
if(sub.cons.permissions.contains("clipboardWrite")) {
var clipOBJ=document.body.appendChild(document.createElement("textarea"));
clipOBJ.focus();
document.execCommand('paste');
var clipData=clipOBJ.value;
clipOBJ.remove();
sub.theConf.paste=clipData;
sendResponse(sub.theConf);//error log, if none sendResponse
sub.checkPermission(["clipboardRead"],null,function(){
var domCB=document.createElement("textarea");
domCB.classList.add("su_cb_textarea");
document.body.appendChild(domCB);
domCB.focus();
document.execCommand("paste");
sub.theConf.paste=domCB.value;
sub.theConf.typeAction="paste";
sendResponse(sub.theConf);
}else {
sub.checkPermission(["clipboardWrite"]);
}
chrome.tabs.sendMessage(sender.tab.id,{type:"actionPaste",value:sub.theConf},function(response){
domCB.remove();
});
});
}else{
sendResponse(sub.theConf);
}
Expand Down
Loading

0 comments on commit 53bd41a

Please sign in to comment.