From 0a05e0089be4d823ac21fa77869b8fb69fd77eb2 Mon Sep 17 00:00:00 2001 From: Jack Rosenthal Date: Sun, 12 May 2019 08:38:16 -0600 Subject: [PATCH] protocol: make RedirectChannel compatible with PM 28.5 The sketchy meta-redirect previously used was no longer working with Palemoon 28.5. This is an even more sketchy version that uses a JavaScript redirect, but seems to work. This redirect screws up the history, so this introduces a new bug as well :/ My XPCOM-fu isn't quite good enough to figure out a nice way to redirect a channel without this crap, so open to suggestions on a more elegant way to solve this. BUG=madand#9 TEST=visited dactyl://help-tag/starting and got to the correct page Signed-off-by: Jack Rosenthal --- common/modules/protocol.jsm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/common/modules/protocol.jsm b/common/modules/protocol.jsm index 235d2cd5..35004f60 100644 --- a/common/modules/protocol.jsm +++ b/common/modules/protocol.jsm @@ -56,10 +56,15 @@ function NetError(orig, error) { function RedirectChannel(to, orig, time, message) { let html = DOM.toXML( ["html", {}, - ["head", {}, - ["meta", { "http-equiv": "Refresh", content: (time || 0) + ";" + to }]], - ["body", {}, - ["h2", { style: "text-align: center" }, message || ""]]]); + ["head", {}, + ["script", {}, + "setTimeout(function () { window.location = '" + + to + + "'; }, " + + ((time || 0) * 1000) + + ");"]], + ["body", {}, + ["h2", { style: "text-align: center" }, message || ""]]]); return StringChannel(html, "text/html", services.io.newURI(to, null, null)); }