mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-07 03:12:33 +01:00
Wait a bit longer before testing viewport width
This commit is contained in:
parent
2d960cf530
commit
b226873bdb
@ -1157,6 +1157,12 @@ const getPopupData = async function(tabId) {
|
||||
});
|
||||
};
|
||||
|
||||
const nextFrames = async n => {
|
||||
for ( let i = 0; i < n; i++ ) {
|
||||
await nextFrame();
|
||||
}
|
||||
};
|
||||
|
||||
// The purpose of the following code is to reset to a vertical layout
|
||||
// should the viewport not be enough wide to accomodate the horizontal
|
||||
// layout.
|
||||
@ -1171,7 +1177,7 @@ const getPopupData = async function(tabId) {
|
||||
const checkViewport = async function() {
|
||||
void document.body.offsetWidth;
|
||||
|
||||
await nextFrame();
|
||||
await nextFrames(4);
|
||||
|
||||
const root = document.querySelector(':root');
|
||||
if ( root.classList.contains('desktop') ) {
|
||||
|
Loading…
Reference in New Issue
Block a user