From 3f325cea256c5fd082a1c029d27f63ab93440ba6 Mon Sep 17 00:00:00 2001 From: hackademix Date: Tue, 5 Mar 2019 00:58:13 +0100 Subject: Fixed inline whitelisting regressions (issue #35). --- html/display_panel/content/main_panel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'html/display_panel/content') diff --git a/html/display_panel/content/main_panel.js b/html/display_panel/content/main_panel.js index 022be8c..83c3a6b 100644 --- a/html/display_panel/content/main_panel.js +++ b/html/display_panel/content/main_panel.js @@ -132,9 +132,9 @@ function createList(data, group){ a.href = scriptId.split("(")[0]; if (scriptId.startsWith("view-source:")) { a.target ="LibreJS-ViewSource"; - let source = scriptId.split("\n")[1]; + let source = scriptId.match(/\n([^]*)/); if (source) { - li.querySelector(".source").textContent = decodeURIComponent(source); + li.querySelector(".source").textContent = source[1]; li.querySelector(".toggle-source").style.display = "inline"; } scriptId = scriptId.replace(viewSourceToHuman, "$3 at line $2 of $1"); -- cgit v1.2.3