node-iframe
Advanced tools
Comparing version 1.5.3 to 1.5.4
@@ -80,6 +80,6 @@ "use strict"; | ||
case 0: | ||
if (!(src && src[0] === "/")) return [3, 5]; | ||
if (!(src && src[0] === "/")) return [3, 6]; | ||
_a.label = 1; | ||
case 1: | ||
_a.trys.push([1, 4, , 5]); | ||
_a.trys.push([1, 5, , 6]); | ||
return [4, isomorphic_unfetch_1["default"](url + "/" + src, { | ||
@@ -93,10 +93,12 @@ headers: config_1.headers | ||
source = _a.sent(); | ||
$html(key).html(source); | ||
return [3, 5]; | ||
return [4, $html(key).html(source)]; | ||
case 4: | ||
_a.sent(); | ||
return [3, 6]; | ||
case 5: | ||
e_1 = _a.sent(); | ||
console.error(e_1); | ||
reject(e_1); | ||
return [3, 5]; | ||
case 5: | ||
return [3, 6]; | ||
case 6: | ||
resolve(src || null); | ||
@@ -149,3 +151,3 @@ return [2]; | ||
case 5: | ||
_k.trys.push([5, 45, , 46]); | ||
_k.trys.push([5, 49, , 50]); | ||
return [4, isomorphic_unfetch_1["default"](url, { | ||
@@ -160,16 +162,19 @@ headers: config_1.headers | ||
$html = cheerio_1.load(html); | ||
if (!!baseHref) { | ||
$html("head").prepend("<base target=\"_self\" href=\"" + url + "\">"); | ||
} | ||
inlineMutations_2 = []; | ||
_k.label = 8; | ||
if (!!!baseHref) return [3, 9]; | ||
return [4, $html("head").prepend("<base target=\"_self\" href=\"" + url + "\">")]; | ||
case 8: | ||
_k.trys.push([8, 14, 15, 20]); | ||
_f = __asyncValues(Object.keys(inline)); | ||
_k.sent(); | ||
_k.label = 9; | ||
case 9: return [4, _f.next()]; | ||
case 9: | ||
inlineMutations_2 = []; | ||
_k.label = 10; | ||
case 10: | ||
if (!(_g = _k.sent(), !_g.done)) return [3, 13]; | ||
_k.trys.push([10, 16, 17, 22]); | ||
_f = __asyncValues(Object.keys(inline)); | ||
_k.label = 11; | ||
case 11: return [4, _f.next()]; | ||
case 12: | ||
if (!(_g = _k.sent(), !_g.done)) return [3, 15]; | ||
key = _g.value; | ||
if (!inline[key]) return [3, 12]; | ||
if (!inline[key]) return [3, 14]; | ||
attribute_1 = "src"; | ||
@@ -182,30 +187,30 @@ return [4, $html(key).attr(attribute_1, function (_, src) { | ||
})]; | ||
case 11: | ||
case 13: | ||
_k.sent(); | ||
_k.label = 12; | ||
case 12: return [3, 9]; | ||
case 13: return [3, 20]; | ||
case 14: | ||
_k.label = 14; | ||
case 14: return [3, 11]; | ||
case 15: return [3, 22]; | ||
case 16: | ||
e_2_1 = _k.sent(); | ||
e_2 = { error: e_2_1 }; | ||
return [3, 20]; | ||
case 15: | ||
_k.trys.push([15, , 18, 19]); | ||
if (!(_g && !_g.done && (_b = _f["return"]))) return [3, 17]; | ||
return [3, 22]; | ||
case 17: | ||
_k.trys.push([17, , 20, 21]); | ||
if (!(_g && !_g.done && (_b = _f["return"]))) return [3, 19]; | ||
return [4, _b.call(_f)]; | ||
case 16: | ||
case 18: | ||
_k.sent(); | ||
_k.label = 17; | ||
case 17: return [3, 19]; | ||
case 18: | ||
_k.label = 19; | ||
case 19: return [3, 21]; | ||
case 20: | ||
if (e_2) throw e_2.error; | ||
return [7]; | ||
case 19: return [7]; | ||
case 20: | ||
_k.trys.push([20, 27, 28, 33]); | ||
case 21: return [7]; | ||
case 22: | ||
_k.trys.push([22, 29, 30, 35]); | ||
inlineMutations_1 = __asyncValues(inlineMutations_2); | ||
_k.label = 21; | ||
case 21: return [4, inlineMutations_1.next()]; | ||
case 22: | ||
if (!(inlineMutations_1_1 = _k.sent(), !inlineMutations_1_1.done)) return [3, 26]; | ||
_k.label = 23; | ||
case 23: return [4, inlineMutations_1.next()]; | ||
case 24: | ||
if (!(inlineMutations_1_1 = _k.sent(), !inlineMutations_1_1.done)) return [3, 28]; | ||
com = inlineMutations_1_1.value; | ||
@@ -215,57 +220,61 @@ key = com.key, attribute = com.attribute, src = com.src; | ||
return [4, mutateSource({ key: element, src: src }, url, $html)]; | ||
case 23: | ||
case 25: | ||
_k.sent(); | ||
return [4, $html(element).removeAttr(attribute)]; | ||
case 24: | ||
case 26: | ||
_k.sent(); | ||
_k.label = 25; | ||
case 25: return [3, 21]; | ||
case 26: return [3, 33]; | ||
case 27: | ||
_k.label = 27; | ||
case 27: return [3, 23]; | ||
case 28: return [3, 35]; | ||
case 29: | ||
e_3_1 = _k.sent(); | ||
e_3 = { error: e_3_1 }; | ||
return [3, 33]; | ||
case 28: | ||
_k.trys.push([28, , 31, 32]); | ||
if (!(inlineMutations_1_1 && !inlineMutations_1_1.done && (_c = inlineMutations_1["return"]))) return [3, 30]; | ||
return [3, 35]; | ||
case 30: | ||
_k.trys.push([30, , 33, 34]); | ||
if (!(inlineMutations_1_1 && !inlineMutations_1_1.done && (_c = inlineMutations_1["return"]))) return [3, 32]; | ||
return [4, _c.call(inlineMutations_1)]; | ||
case 29: | ||
case 31: | ||
_k.sent(); | ||
_k.label = 30; | ||
case 30: return [3, 32]; | ||
case 31: | ||
_k.label = 32; | ||
case 32: return [3, 34]; | ||
case 33: | ||
if (e_3) throw e_3.error; | ||
return [7]; | ||
case 32: return [7]; | ||
case 33: | ||
_k.trys.push([33, 38, 39, 44]); | ||
_h = __asyncValues(Object.keys(cors)); | ||
_k.label = 34; | ||
case 34: return [4, _h.next()]; | ||
case 34: return [7]; | ||
case 35: | ||
if (!(_j = _k.sent(), !_j.done)) return [3, 37]; | ||
key = _j.value; | ||
if (cors[key]) { | ||
$html(key).attr("crossorigin", cors[key]); | ||
} | ||
$html("[src=\"undefined\"]").removeAttr("src"); | ||
_k.label = 36; | ||
case 36: return [3, 34]; | ||
case 37: return [3, 44]; | ||
case 36: | ||
_k.trys.push([36, 42, 43, 48]); | ||
_h = __asyncValues(Object.keys(cors)); | ||
_k.label = 37; | ||
case 37: return [4, _h.next()]; | ||
case 38: | ||
if (!(_j = _k.sent(), !_j.done)) return [3, 41]; | ||
key = _j.value; | ||
if (!cors[key]) return [3, 40]; | ||
return [4, $html(key).attr("crossorigin", cors[key])]; | ||
case 39: | ||
_k.sent(); | ||
_k.label = 40; | ||
case 40: return [3, 37]; | ||
case 41: return [3, 48]; | ||
case 42: | ||
e_4_1 = _k.sent(); | ||
e_4 = { error: e_4_1 }; | ||
return [3, 44]; | ||
case 39: | ||
_k.trys.push([39, , 42, 43]); | ||
if (!(_j && !_j.done && (_d = _h["return"]))) return [3, 41]; | ||
return [3, 48]; | ||
case 43: | ||
_k.trys.push([43, , 46, 47]); | ||
if (!(_j && !_j.done && (_d = _h["return"]))) return [3, 45]; | ||
return [4, _d.call(_h)]; | ||
case 40: | ||
case 44: | ||
_k.sent(); | ||
_k.label = 41; | ||
case 41: return [3, 43]; | ||
case 42: | ||
_k.label = 45; | ||
case 45: return [3, 47]; | ||
case 46: | ||
if (e_4) throw e_4.error; | ||
return [7]; | ||
case 43: return [7]; | ||
case 44: | ||
case 47: return [7]; | ||
case 48: | ||
cache_1.appCache.set(url, $html.html()); | ||
@@ -276,7 +285,7 @@ if (server) { | ||
return [2, $html]; | ||
case 45: | ||
case 49: | ||
e_6 = _k.sent(); | ||
console.error(e_6); | ||
return [3, 46]; | ||
case 46: return [2, renderErrorHtml({ url: url, server: server, noPage: true })]; | ||
return [3, 50]; | ||
case 50: return [2, renderErrorHtml({ url: url, server: server, noPage: true })]; | ||
} | ||
@@ -283,0 +292,0 @@ }); |
{ | ||
"name": "node-iframe", | ||
"version": "1.5.3", | ||
"version": "1.5.4", | ||
"description": "create a iframe on your server to bypass CORS issues. ( reverse engineer security issues )", | ||
@@ -5,0 +5,0 @@ "main": "dist/iframe.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46684
736