Skip to content

Commit

Permalink
github.com: temporary disable for Turbo navigation, issue #50
Browse files Browse the repository at this point in the history
  • Loading branch information
martok committed Oct 16, 2022
1 parent 01a436b commit 5e1c7d8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/polyfills.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,14 @@ exports.Github_enableDiffButton = jss`
for (let button of document.getElementsByClassName("load-diff-button"))
button.removeAttribute("disabled");
}, {once: true});
// TEMPORARY: hard-disable Turbo navigation to prevent memory leaks in Pale Moon
document.addEventListener("DOMContentLoaded", () => {
Turbo.session.elementIsNavigatable = (e) => false;
Turbo.session.formMode = "off";
Turbo.session.willFollowLinkToLocation = (l, ll, e) => false;
const FrameElement = document.createElement("turbo-frame").constructor;
FrameElement.delegateConstructor.prototype.shouldInterceptNavigation = (e, s=null) => false
});
`

exports.Element_attachShadow = jss`
Expand Down

0 comments on commit 5e1c7d8

Please sign in to comment.