Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Support more per-domain settings #3636
Comments
The-Compiler
added
component: config
priority: 1 - middle
labels
Feb 25, 2018
This was referenced Feb 25, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
Waples
Mar 6, 2018
Would like to see per-domain 'auto accept permissions for audio/video', for example Slack Calls from a trusted domain.
Don't know how I can help, but if I can, tell me ^^
Waples
commented
Mar 6, 2018
|
Would like to see per-domain 'auto accept permissions for audio/video', for example Slack Calls from a trusted domain. Don't know how I can help, but if I can, tell me ^^ |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
The-Compiler
Mar 6, 2018
Collaborator
@Waples Already mentioned as "Permissions" above (also, yay, my name is Florian too
|
@Waples Already mentioned as "Permissions" above (also, yay, my name is Florian too |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
Waples
Mar 6, 2018
Yeah saw it just now, sorry for the bump. (also, small world cause my last name also starts with a B :') )
Waples
commented
Mar 6, 2018
|
Yeah saw it just now, sorry for the bump. (also, small world cause my last name also starts with a B :') ) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
m-j-r
Mar 10, 2018
I like the idea of downloads.location.* being site specific - allows me to not have to fiddle around when e.g. saving bank statements into 'statement folder' and then remembering to change it back to downloads next time.
m-j-r
commented
Mar 10, 2018
|
I like the idea of downloads.location.* being site specific - allows me to not have to fiddle around when e.g. saving bank statements into 'statement folder' and then remembering to change it back to downloads next time. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
Zekario
Mar 18, 2018
I'd like per-domain fonts. I prefer my built in fonts for most websites, but if I disable remote fonts globally a few sites I use a lot are missing icons.
Zekario
commented
Mar 18, 2018
|
I'd like per-domain fonts. I prefer my built in fonts for most websites, but if I disable remote fonts globally a few sites I use a lot are missing icons. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
Ambrevar
Mar 19, 2018
If I understand this correctly, Qutebrowser 1.2.1 does not allow for per-domain stylesheets yet?
Ambrevar
commented
Mar 19, 2018
|
If I understand this correctly, Qutebrowser 1.2.1 does not allow for per-domain stylesheets yet? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment|
@Ambrevar Correct. |
The-Compiler commentedFeb 25, 2018
Split off from #27 - settings which would be useful per-domain:
Some more musings about what code this is going to affect how, what's possible to set, and what kind of URLs should be affected, prompted by this IRC conversation:
We basically have three kind of URLs:
User stylesheets
QtWebKit
We can use QWebSettings::setUserStyleSheetUrl based on the top-level URL.
QtWebEngine
Since we use JavaScript to apply the stylesheet, it's probably easy to get the frame URL, and I think it's better to use that for the stylesheet. In other words, if you're on www.example.com and that has an iframe for www.youtube.com, the stylesheet for example.com doesn't apply in the YouTube frame.
We could also format the top-level URL into JavaScript from Python (or get it in JS directly? Probably not?) - but I think we don't need it at all.
Cookies
QtWebKit
In QNetworkCookieJar::insertCookie we should be able get the resource URL (?) via QNetworkCookie::domain. I'm not sure whether we can get the top-level URL in any way...
QtWebEngine
There's no cookie filter API yet (WIP Qt 5.11 change). We could probably watch QWebEngineCookieStore::cookieAdded and call deleteCookie right away.
Looks like there's no way to get the top-level URL here either?
User agent
QtWebKit
Override QWebEnginePage::userAgentForUrl. We can probably get both the top-level URL (from the page) and the request URL.
QtWebEngine
We have the user agent set via QWebEngineProfile::setHttpUserAgent and that's global. However, at least for headers (but not
window.navigator.userAgent) we can use QWebEngineUrlRequestInterceptor to return an user agent based on the top-level and request URL.Other headers
QtWebKit
We can set those in
createRequestbased on the resource URL.QtWebEngine
We can set those with a
QWebEngineUrlRequestInterceptorbased on the resource and top-level URL.Requests
QtWebKit
With QNetworkAccessManager::createRequest we can get the QNetworkRequest. However, we can't really get much information from there (e.g. the type of the request).
QtWebEngine
With a QWebEngineUrlRequestInterceptor we can get some infos about requests, allowing for something uMatrix-like. See #2626, #28.
Bindings
Haven't looked into that yet, but the code handling the bindings can probably just look at the current URL. This one should be backend independent.
In addition to adding new bindings, it should be possible to selectively unbind bindings for a page.
Permissions
QtWebKit
QWebPage::featurePermissionRequested gives us the
QWebFrame(and thus frame URL), we can get the top-level URL from the page.QtWebEngine
QWebEnginePage::featurePermissionRequested gives us the securityOrigin (frame URL?) and we can get the top-level URL from the page.
Proxy
QtWebKit
TODO
QtWebEngine
TODO
Other
Some other settings which could apply per-domain based on the current URL, but where it's questionable whether there's an use-case:
aliasesignore_casecontent.host_blocking.enabled(to selectively turn off adblocking)content.host_blocking.whitelist(could be merged into.enabledwith top-level/origin URL?)content.javascript.alert/.log/.promptdownloads.location.*hints.*_regexesat least.forward_unbound_keys, etc.)zoom.default