Created
September 6, 2018 22:53
-
-
Save olmokramer/fe23c8cdd29a8b567343aa575e5cdeaa to your computer and use it in GitHub Desktop.
Qutebrowser per-domain stylesheets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c.content.user_stylesheets = ['/path/to/reddit.user.css'] | |
# or if you have a directory with .user.css files: | |
import glob | |
c.content.user_stylesheets = glob.glob('/path/to/*.user.css') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name DomainStyles | |
// @namespace https://github.com/olmokramer | |
// @description Make it possible to use per-domain stylesheets. | |
// @include * | |
// @run-at document-start | |
// @version 2 | |
// @author Olmo Kramer | |
// ==/UserScript== | |
(function IIFE() { | |
'use strict'; | |
document.addEventListener('readystatechange', function onReadyStateChange() { | |
if (document.readyState == 'interactive') { | |
const doc = document.documentElement; | |
doc.setAttribute('data-qb-url', window.location.href); | |
doc.setAttribute('data-qb-domain', window.location.host); | |
} | |
}); | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Sticky header. */ | |
[data-qb-domain="www.reddit.com"] #header, | |
[data-qb-domain="old.reddit.com"] #header { | |
position: sticky !important; | |
top: 0 !important; | |
z-index: 1000 !important; | |
} | |
[data-qb-domain="www.reddit.com"] #sr-header-area, | |
[data-qb-domain="old.reddit.com"] #sr-header-area { | |
position: relative !important; | |
z-index: 1000 !important; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
is there a way to bypass restrictive security policy here?
It throws errors like this: