mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-11 09:31:01 +01:00
Ensure either .desktop
or .mobile
class is set
One of these must always be present. This commit fixes a theoretical case where neither of these classes are set on the body element.
This commit is contained in:
parent
e9f9b5f622
commit
5229e0c810
1 changed files with 2 additions and 9 deletions
|
@ -94,16 +94,9 @@ DOMListFactory.nodeFromSelector = function(selector) {
|
|||
|
||||
{
|
||||
const root = DOMListFactory.root = document.querySelector(':root');
|
||||
if (
|
||||
window.matchMedia('(pointer: coarse)').matches ||
|
||||
window.matchMedia('(hover: none)').matches
|
||||
) {
|
||||
if ( vAPI.webextFlavor.soup.has('mobile') ) {
|
||||
root.classList.add('mobile');
|
||||
}
|
||||
if (
|
||||
window.matchMedia('(pointer: fine)').matches &&
|
||||
window.matchMedia('(hover: hover)').matches
|
||||
) {
|
||||
} else {
|
||||
root.classList.add('desktop');
|
||||
}
|
||||
if ( window.matchMedia('(min-resolution: 150dpi)').matches ) {
|
||||
|
|
Loading…
Reference in a new issue