Skip to content

Commit

Permalink
Fix jsonp
Browse files Browse the repository at this point in the history
  • Loading branch information
lauriro committed Jun 9, 2024
1 parent b899da0 commit 070d243
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ function func(rand, opts, op, msg) {
}

function draw(str, to, first, box) {
var afterColon
var afterColon, tmp
, spaces = ""
, node = div.cloneNode()
, link = el("a", 0, "l")
Expand Down Expand Up @@ -394,7 +394,7 @@ function func(rand, opts, op, msg) {
if (nav.serverTiming && nav.serverTiming.length) el("div", node, "p").textContent = "// serverTiming: " + JSON.stringify(nav.serverTiming)
} catch(e) {}
try {
window.data = str ? JSON.parse(str) : Error("Empty JSON")
window.data = str ? JSON.parse(jsonp ? jsonp[2] : str) : Error("Empty JSON")
} catch(e) {
el("div", node, "e").textContent = e
}
Expand Down Expand Up @@ -430,7 +430,8 @@ function func(rand, opts, op, msg) {
}
loop(jsonp ? jsonp[2] : str, re)
if (jsonp) {
body.lastChild.firstChild.firstChild.textContent = jsonp[1] + body.lastChild.firstChild.firstChild.textContent
tmp = body.querySelector("i")
tmp.textContent = jsonp[1] + tmp.textContent
body.lastChild.lastChild.textContent += jsonp[3]
}

Expand Down

0 comments on commit 070d243

Please sign in to comment.