node-iframe
Advanced tools
Comparing version 1.7.5 to 1.8.0
@@ -49,8 +49,5 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
exports.__esModule = true; | ||
exports.fetchFrame = exports.configureTemplates = exports.configureResourceControl = exports.configureAgent = exports.appSourceConfig = void 0; | ||
var isomorphic_unfetch_1 = __importDefault(require("isomorphic-unfetch")); | ||
var fetch_1 = require("./fetch"); | ||
var cheerio_1 = require("cheerio"); | ||
@@ -71,3 +68,2 @@ var templates_1 = require("./templates"); | ||
else if (setAgent(false)) { | ||
setAgent(false); | ||
return httpsAgent; | ||
@@ -115,3 +111,3 @@ } | ||
_c.trys.push([1, 5, , 6]); | ||
return [4, (0, isomorphic_unfetch_1["default"])("".concat(url, "/").concat(src), { | ||
return [4, (0, fetch_1.fetcher)("".concat(url, "/").concat(src), { | ||
headers: headers, | ||
@@ -148,5 +144,5 @@ agent: agent | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _c, inline, cors, headers, response, e_2, html, $html, inlineMutations_2, _loop_1, _i, _d, key, _e, inlineMutations_1, com, key, attribute, src, element, _f, _g, key, e_3; | ||
return __generator(this, function (_h) { | ||
switch (_h.label) { | ||
var _c, inline, cors, headers, response, e_2, html, _d, $html, inlineMutations_2, _loop_1, _i, _e, key, _f, inlineMutations_1, com, key, attribute, src, element, _g, _h, key, e_3; | ||
return __generator(this, function (_j) { | ||
switch (_j.label) { | ||
case 0: | ||
@@ -161,6 +157,6 @@ if (!url) { | ||
headers = __assign(__assign({}, config_1.appHeaders), head); | ||
_h.label = 1; | ||
_j.label = 1; | ||
case 1: | ||
_h.trys.push([1, 3, , 4]); | ||
return [4, (0, isomorphic_unfetch_1["default"])(url, { | ||
_j.trys.push([1, 3, , 4]); | ||
return [4, (0, fetch_1.fetcher)(url, { | ||
headers: head, | ||
@@ -170,16 +166,22 @@ agent: agent | ||
case 2: | ||
response = _h.sent(); | ||
response = _j.sent(); | ||
return [3, 4]; | ||
case 3: | ||
e_2 = _h.sent(); | ||
e_2 = _j.sent(); | ||
console.error(e_2); | ||
return [3, 4]; | ||
case 4: | ||
if (!response) return [3, 12]; | ||
_h.label = 5; | ||
if (!response) return [3, 14]; | ||
_j.label = 5; | ||
case 5: | ||
_h.trys.push([5, 11, , 12]); | ||
return [4, response.text()]; | ||
case 6: | ||
html = _h.sent(); | ||
_j.trys.push([5, 13, , 14]); | ||
if (!process) return [3, 6]; | ||
_d = response; | ||
return [3, 8]; | ||
case 6: return [4, response.text()]; | ||
case 7: | ||
_d = _j.sent(); | ||
_j.label = 8; | ||
case 8: | ||
html = _d; | ||
if (!html) { | ||
@@ -204,25 +206,25 @@ return [2, renderErrorHtml({ url: url, server: server, noPage: true })]; | ||
}; | ||
for (_i = 0, _d = Object.keys(inline); _i < _d.length; _i++) { | ||
key = _d[_i]; | ||
for (_i = 0, _e = Object.keys(inline); _i < _e.length; _i++) { | ||
key = _e[_i]; | ||
_loop_1(key); | ||
} | ||
_e = 0, inlineMutations_1 = inlineMutations_2; | ||
_h.label = 7; | ||
case 7: | ||
if (!(_e < inlineMutations_1.length)) return [3, 10]; | ||
com = inlineMutations_1[_e]; | ||
_f = 0, inlineMutations_1 = inlineMutations_2; | ||
_j.label = 9; | ||
case 9: | ||
if (!(_f < inlineMutations_1.length)) return [3, 12]; | ||
com = inlineMutations_1[_f]; | ||
key = com.key, attribute = com.attribute, src = com.src; | ||
element = "".concat(key, "[").concat(attribute, "=\"").concat(src, "\"]"); | ||
return [4, mutateSource({ key: element, src: src }, url, $html, headers)]; | ||
case 8: | ||
_h.sent(); | ||
case 10: | ||
_j.sent(); | ||
$html(element).removeAttr(attribute); | ||
_h.label = 9; | ||
case 9: | ||
_e++; | ||
return [3, 7]; | ||
case 10: | ||
_j.label = 11; | ||
case 11: | ||
_f++; | ||
return [3, 9]; | ||
case 12: | ||
$html("[src=\"undefined\"]").removeAttr("src"); | ||
for (_f = 0, _g = Object.keys(cors); _f < _g.length; _f++) { | ||
key = _g[_f]; | ||
for (_g = 0, _h = Object.keys(cors); _g < _h.length; _g++) { | ||
key = _h[_g]; | ||
if (cors[key]) { | ||
@@ -233,7 +235,7 @@ $html(key).attr("crossorigin", cors[key]); | ||
return [2, $html]; | ||
case 11: | ||
e_3 = _h.sent(); | ||
case 13: | ||
e_3 = _j.sent(); | ||
console.error(e_3); | ||
return [3, 12]; | ||
case 12: return [2, renderErrorHtml({ url: url, server: server, noPage: true })]; | ||
return [3, 14]; | ||
case 14: return [2, renderErrorHtml({ url: url, server: server, noPage: true })]; | ||
} | ||
@@ -240,0 +242,0 @@ }); |
{ | ||
"name": "node-iframe", | ||
"version": "1.7.5", | ||
"version": "1.8.0", | ||
"description": "create iframes on your server to bypass CORS. Reverse engineer security issues.", | ||
@@ -19,4 +19,3 @@ "main": "dist/iframe.js", | ||
"dependencies": { | ||
"cheerio": "^1.0.0-rc.3", | ||
"isomorphic-unfetch": "^3.1.0" | ||
"cheerio": "^1.0.0-rc.3" | ||
}, | ||
@@ -23,0 +22,0 @@ "devDependencies": { |
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
51177
1
53
842
4
- Removedisomorphic-unfetch@^3.1.0
- Removedisomorphic-unfetch@3.1.0(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removedunfetch@4.2.0(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)