Skip to content

Instantly share code, notes, and snippets.

@cynecx
Last active October 9, 2020 00:30
Show Gist options
  • Select an option

  • Save cynecx/5b0c9995eae7bb00f05e905da2fa4e58 to your computer and use it in GitHub Desktop.

Select an option

Save cynecx/5b0c9995eae7bb00f05e905da2fa4e58 to your computer and use it in GitHub Desktop.
Fix Github Mobile (iOS Safari - Shortcuts - Run Javascript on Web page)
(function () {
function fixMobileGithub(document) {
Array.from(document.getElementsByClassName("pr-toolbar")).forEach(toolbar => {
toolbar.classList.remove("js-sticky", "js-position-sticky", "is-stuck");
toolbar.style.position = "unset";
toolbar.style.top = "";
toolbar.style.padding = "";
});
Array.from(document.getElementsByClassName("file-header")).forEach(header => {
header.classList.remove("sticky-file-header", "js-position-sticky");
header.style.cssText = "flex-direction: row !important;";
});
let files = document.getElementById("files");
if (files) {
files.style.margin = "0px -17px 0px -17px";
}
let notification = document.getElementsByClassName("notification-shelf");
if (notification.length) {
notification[0].style.position = "unset";
}
["gh-header-shadow", "gh-header-sticky"].forEach(className => {
Array.from(document.getElementsByClassName(className)).forEach(element => {
element.remove();
});
});
}
fixMobileGithub(document);
completion();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment