Skip to content

Commit 38bdfff

Browse files
save file
1 parent 98d15a6 commit 38bdfff

File tree

1 file changed

+26
-14
lines changed

1 file changed

+26
-14
lines changed

utils/browser-extensions/cors/cors.html

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,9 @@ <h3>
142142

143143
initdom();
144144

145-
}//onload
145+
}//init
146146

147147

148-
//:
149-
150-
151148
async function libs(){
152149

153150
jszip = await import('https://cdn.jsdelivr.net/npm/jszip/+esm');
@@ -160,6 +157,9 @@ <h3>
160157
//:
161158

162159

160+
var tabs;
161+
162+
163163
var btn = {};
164164

165165

@@ -171,6 +171,10 @@ <h3>
171171
$('#chrome').onclick = btn.chrome;
172172
$('#firefox').onclick = btn.firefox;
173173

174+
tabs = $('#tabs');
175+
tabs.onclick = btn.tabs;
176+
177+
174178
}//initdom
175179

176180

@@ -207,17 +211,25 @@ <h3>
207211
}//firefox
208212

209213

214+
btn.tabs = function(e){
215+
216+
var node = e.target;
217+
var name = node.textContent.trim();
218+
debug(name);
219+
}//tabs
220+
221+
210222
//:
211223

212224

213225

214226

215227

216228
async function create(dir,{download=true,test,df=false}={}){
217-
df && console.log('download',download);
218-
df && console.log('test',!!test);
219-
df && console.json(dir);
220-
df && console.log();
229+
df && debug('download',download);
230+
df && debug('test',!!test);
231+
df && debug.json(dir);
232+
df && debug();
221233
var zip;
222234
if(!test){
223235
zip = new jszip();
@@ -250,12 +262,12 @@ <h3>
250262
for(let key in dir){
251263

252264
total++;
253-
df && console.log(total,key);
265+
df && debug(total,key);
254266

255267
var o = dir[key];
256268

257269
if(o.directory){
258-
df && console.log('dir :',abs+key);
270+
df && debug('dir :',abs+key);
259271
if(zip){
260272
zip.folder(abs+key);
261273
}
@@ -264,7 +276,7 @@ <h3>
264276
}
265277

266278
if(o.file?.contents){
267-
df && console.log('file create :',abs+key);
279+
df && debug('file create :',abs+key);
268280
if(zip){
269281
zip.file(abs+key,o.file.contents);
270282
}
@@ -284,8 +296,8 @@ <h3>
284296
if(path.startsWith('/')){
285297
path = path.slice(1);
286298
}
287-
df && console.log('file github :',abs+key);
288-
df && console.log(owner,repo,branch,path);
299+
df && debug('file github :',abs+key);
300+
df && debug(owner,repo,branch,path);
289301
if(zip){
290302
fetch(`https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${path}`)
291303
.then(res=>res.text().then(txt=>{
@@ -304,7 +316,7 @@ <h3>
304316
function complete(){
305317

306318
ct++;
307-
df && console.log(ct,total);
319+
df && debug(ct,total);
308320
if(ct==total){
309321
resolve();
310322
}

0 commit comments

Comments
 (0)