MCPcopy Create free account
hub / github.com/hoothin/UserScripts / openInTop

Function openInTop

Picviewer CE+/dist.user.js:24802–24840  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24800
24801 var self=this;
24802 async function openInTop(){
24803 var data=self.data;
24804
24805 //删除不能发送的项。
24806 var delCantClone=function(obj){
24807 if(!obj)return;
24808 delete obj.img;
24809 delete obj.imgPA;
24810 };
24811
24812 if(Array.isArray(data)){
24813 frameSentSuccessData=frameSentData;
24814 frameSentData=cloneObject(data,true);
24815 delCantClone(data.target);
24816 data.forEach(function(obj){
24817 delCantClone(obj);
24818 });
24819 }else{
24820 delCantClone(data);
24821 };
24822
24823 if(!gallery){
24824 gallery=new GalleryC();
24825 gallery.data=[];
24826 }
24827 let allData=(await gallery.getAllValidImgs()).map(item => item.src);
24828 allData = allData.filter((item, index) => {
24829 return allData.indexOf(item) === index;
24830 });
24831 data.all = allData;
24832 window.postMessage({
24833 messageID:messageID,
24834 src:img.src,
24835 data:data,
24836 command:'open',
24837 buttonType:buttonType,
24838 to:'top',
24839 },'*');
24840 };
24841
24842 if(this.openInTopWindow && isFrame && topWindowValid!==false && buttonType!='magnifier' && !isLargeFrame()){
24843 if(topWindowValid){

Callers 1

initFunction · 0.70

Calls 2

cloneObjectFunction · 0.70
delCantCloneFunction · 0.70

Tested by

no test coverage detected