Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.

Commit

Permalink
protocol: make RedirectChannel compatible with PM 28.5
Browse files Browse the repository at this point in the history
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 <jack@rosenth.al>
  • Loading branch information
jackrosenthal committed May 12, 2019
1 parent 00536f5 commit 0a05e00
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions common/modules/protocol.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down

0 comments on commit 0a05e00

Please sign in to comment.