A collection of JavaScript fixes for various websites that can be used with SafariX tweak. Each fix includes a description of the issue it solves and the JavaScript code to fix it. To use it, go to SafariX settings -> JavaScript Injection -> add the domain as stated in this gist -> press on the domain -> enable subdomains if needed -> paste the js code into the text box below the toggle
iOS: 15/16
Domain: chatgpt.com
Issue: Unable to scroll through long responses, scroll gets stuck
Fix code:
(function() {
// Allow scrolling on all possible containers
const elements = [
document.documentElement,
document.body,
document.querySelector('main'),
document.querySelector('.overflow-hidden'),
document.querySelector('[role="presentation"]'),
...document.querySelectorAll('.overflow-hidden'),
...document.querySelectorAll('[style*="overflow: hidden"]'),
...document.querySelectorAll('[style*="position: fixed"]')
];
elements.forEach(el => {
if (el) {
el.style.cssText = `
overflow: auto !important;
position: relative !important;
height: auto !important;
max-height: none !important;
overscroll-behavior: auto !important;
-webkit-overflow-scrolling: touch !important;
`;
}
});
// Force layout recalculation
window.dispatchEvent(new Event('resize'));
// Remove any classes that might block scrolling
document.querySelectorAll('*').forEach(el => {
if (el.classList.contains('overflow-hidden')) {
el.classList.remove('overflow-hidden');
}
});
})();
iOS: 15/16
Domain: chatgpt.com
Issue: Unable to scroll through long responses, scroll gets stuck
Fix code:
(function () {document.querySelectorAll(‘html *’).forEach(function(node) {var s = getComputedStyle(node);if (‘hidden’ === s[‘overflow’]) { node.style[‘overflow’] = ‘visible’; }});})();
Userscript Versions Available:
I’ve tested both scripts using [Tampermonkey](https://apps.apple.com/us/app/tampermonkey/id6738342400) on iOS 15.4.1, and they work perfectly.
Huge thanks to @0xkuj for the original JavaScript! 🙌