commit 1018b71c4cc57ed4f65454efaa6cfc9c98417bef
parent 7a84063303449d6e7e781562adc7d383bccae8d1
Author: William Casarin <jb55@jb55.com>
Date: Sun, 10 Sep 2023 13:14:59 -0700
qutebrowser: add remove-sticky script binding
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/dotfiles/.config/qutebrowser/config.py b/dotfiles/.config/qutebrowser/config.py
@@ -75,6 +75,13 @@ config.bind('e', 'open-editor')
config.bind('co', 'tab-only')
config.bind('gl', 'tab-move +')
config.bind('gh', 'tab-move -')
+
+# Remove fixed, sticky elements from pages.
+# This is useful to recover full page scrolling
+#config.bind(',s', 'jseval javascript:(function(){x=document.querySelectorAll(`*`);for(i=0;i<x.length;i++){elementStyle=getComputedStyle(x[i]);if(elementStyle.position.startsWith("fixed")||elementStyle.position.startsWith("sticky")){x[i].style.position=`absolute`;}}}())')
+
+config.bind(',s', "jseval javascript:(function(){var elements=document.querySelectorAll(`*`);Array.from(elements).forEach(function(element){var style=getComputedStyle(element);if(style.position.startsWith(`fixed`)||style.position.startsWith(`sticky`)){element.style.cssText+=`position: absolute !important;`;}});})()")
+
config.bind('gF', 'hint all tab-bg')
config.unbind('D')
config.bind('Do', 'download-open')