Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

[bug] Cropped uMatrix popup in Chrome #423

Closed
wolph opened this issue Nov 30, 2015 · 15 comments
Closed

[bug] Cropped uMatrix popup in Chrome #423

wolph opened this issue Nov 30, 2015 · 15 comments

Comments

@wolph
Copy link
Contributor

wolph commented Nov 30, 2015

Disclaimer: I've only recently started using uMatrix so I'm not sure if this problem existed before.

At times my uMatrix popup is too small to be usable, opening it again solves the issue but it's annoying in the mean time. It happens at a regular basis (couple of times a day) without any discernible pattern.

screen shot 2015-11-30 at 20 40 59

Versions:
uMatrix: 0.9.3.1
Chrome: 45.0.2454.93 (64-bit)
os: os x yosemite (10.10)

@gorhill
Copy link
Owner

gorhill commented Nov 30, 2015

You will have to open an issue with the Chromium project, the popup size & position is entirely under the control of the browser -- it is supposed to adjust automatically to the embedded HTML.

@gorhill gorhill closed this as completed Nov 30, 2015
@gorhill
Copy link
Owner

gorhill commented Nov 30, 2015

https://code.google.com/p/chromium/issues/detail?id=457887:

I guess there's something wrong with the way that we resize popups on mac.

@wolph
Copy link
Contributor Author

wolph commented Nov 30, 2015

From my experience the Chromium dev team tends to take many years to fix issues, if at all.

Would it be an option to give the popup a larger size by default and when actually filling it, scale down if needed. That way the worst thing that could happen is that the popup is larger than needed on OS X. Perhaps a min-width or something in the <body> style of popup.html could do the trick?

@wolph
Copy link
Contributor Author

wolph commented Dec 1, 2015

It should be noted that uMatrix is the only extension that exhibits this behaviour. I have about 10-15 extensions with popups and I've never had these problems before. So it must be related to how the popup content is formed.

@wolph
Copy link
Contributor Author

wolph commented Dec 1, 2015

For the time being I'll just run my own version of uMatrix with a fixed height/width. I'm not sure if there's a good workaround available, setting the min-height/max-height and/or min-width/max-width has no effect but setting the height and width to a fixed value works just fine for me.

Obviously... some people have smaller screens so it's not a universal solution.

@gorhill
Copy link
Owner

gorhill commented Dec 1, 2015

So it must be related to how the popup content is formed.

The size of the matrix depends on how much stuff is reported in it. Most other extensions are static in size. But as per bug description over at the chromium project, it is a problem which affects any extension with variable size.

@wolph
Copy link
Contributor Author

wolph commented Dec 1, 2015

It's most likely a timing issue. I think it measures the size from the content at a certain point in time and because the data is added later it might not always work correctly.

That would also explain why it works sometimes and is broken at other times, the big question is how we can force a resize/redraw without breaking other stuff. I'll test a bit

@wolph
Copy link
Contributor Author

wolph commented Dec 1, 2015

Ok, I may have found a fix (at least, it appears to be working correctly so far). By adding a clearing div at the bottom of the popup.html file it appears to be working.

So somewhere below the content just add this:

<div style="clear: both;">&nbsp;</div>

I'll keep testing and create a pull request if it's a permanent fix.

@gorhill
Copy link
Owner

gorhill commented Dec 1, 2015

I'll keep testing and create a pull request if it's a permanent fix.

This will have to be tested on Firefox, Palemoon, Seamonkey, Chromium, Opera as well to be sure there is no bad side-effect.

@wolph
Copy link
Contributor Author

wolph commented Dec 1, 2015

I've tested both Chrome and Firefox and see no adverse effects but I'm not a 100% sure about the rest.

Having that said, clear divs are a common solution for design problems in websites so I think it's quite a low risk change. Worst case I can think of if some browsers perhaps ignore the height setting and add blank space at the bottom of the popup.

gorhill added a commit that referenced this issue Dec 1, 2015
Fixed chrome os x issue with too small popup size (fixes #423)
@filipecatraia
Copy link

filipecatraia commented Feb 1, 2017

This is old and closed, but still happening:

umatrixpopupbug

For reference: using Chromium 55.0.2883.75 (64-bit), OSX 10.12.3, uMatrix 0.9.3.6, uBlock 1.9.10.

@wolph
Copy link
Contributor Author

wolph commented Feb 1, 2017

Yes, it appears to have worked for a little while but chrome broke it again. The last few chrome versions actually gave me weird rendering bugs all over the place so I'm simply not using it much anymore.

@amithiel
Copy link

using chrome Version 56.0.2924.87 (64-bit) on OSX Sierra. umatrix 0.9.9b4 + ublock origin 1.11.0, bug still exists. window is cropped most of the time

@Kadigan
Copy link

Kadigan commented Apr 24, 2017

Bug still there on Chrome Version 58.0.3029.81 (64-bit) @ macOS Sierra 10.12.4, using uMatrix v1.0.0. Very, very annoying (even if it ultimately isn't uMatrix's fault). My boss is pressuring me to remove it because it takes a lot of time to set anything.

@shazow
Copy link

shazow commented May 4, 2017

In case this is helpful for anyone, this is a nasty dirty hacky workaround I'm using in another extension which seems to help:

setTimeout(function() {
    // Resize the window a tiny bit which forces a subtle rerender that
    // fixes a bug where the popup is rendered in the wrong size initially
    // sometimes.
    document.body.style.height = window.innerHeight + 1 + "px";
    setTimeout(function() {
        // We can't remove the property too soon or otherwise it might happen
        // before the popup render glitch. We'd rather not keep it either
        // because the size of our widget can change after some UI flows.
        document.body.style.removeProperty("height");
    }, 100);
}, 200);

Noxgrim pushed a commit to Noxgrim/uMatrix that referenced this issue Dec 29, 2021
Noxgrim pushed a commit to Noxgrim/uMatrix that referenced this issue Dec 29, 2021
Fixed chrome os x issue with too small popup size (fixes gorhill#423)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants