ertug / autohidpi

Firefox Add-on: Set a different pixel ratio (layout.css.devPixelsPerPx) for each of your screens. Useful for mixed-DPI multi-monitor setups. For example, you can use it if you have one HiDPI (Retina) screen and one lower-DPI HD screen.
https://addons.mozilla.org/en-US/firefox/addon/autohidpi/
Mozilla Public License 2.0
30 stars 12 forks source link

Port to WebExtensions #23

Open acmiyaguchi opened 7 years ago

acmiyaguchi commented 7 years ago

This addon is awesome and has been valuable to my mixed dpi setup. However, this addon has been marked as 'legacy' in about:addons on recent builds of Firefox 55 nightly due to the transition to WebExtensions in FF57. In particular, it looks like legacy addons will no longer be supported mid-June on nightly and developer channels.

This MDN comparison between the SDK and WebExtensions seems like a good starting place to look.

gerv commented 7 years ago

@ertug: ping? Can you confirm whether or not you plan to update this great add-on?

ertug commented 7 years ago

Thank you! I'd want to but I didn't have the time. I will try to look into it.

ertug commented 7 years ago

I had a look at the WebExtensions API and noticed that the API for setting layout.css.devPixelsPerPx is missing. I found a bug about it that also mentions AutoHiDPI: https://bugzilla.mozilla.org/show_bug.cgi?id=1373607

alexbel commented 6 years ago

@ertug looks like layout.css.devPixelsPerPx is back in Firefox 57.0

gerv commented 6 years ago

@alexbel No one ever said the pref was missing. But WebExtensions can't alter arbitrary preferences.

mcanonic commented 6 years ago

Without this extension my second monitor is useless. Firefox was the only one app able to auto-adapt to screen with different density. Too bad.

kalliste commented 6 years ago

Setting layout.css.devPixelsPerPx to -1 seems to make it do the right thing for me in Firefox 57

mcanonic commented 6 years ago

I tried but the firefox does not change its aspect on my two monitors. Did you set something else? Did you keep this parameter as "string"?

gerv commented 6 years ago

What "-1" seems to do is to cause Firefox to calculate a good value for this pref every time it restarts. I don't think it's possible to get Firefox to render at a different perpx value on two monitors simultaneously.

kalliste commented 6 years ago

On Firefox 57 on Mac it is readjusting for me each time I move between the retina display and the external monitor, without restarting the browser. This was working with the value set as -1 and is now still working with the value reset to default and showing as -1.0

mcanonic commented 6 years ago

Thanks, it seems that this does not work on Linux. Has anyone tried this on Linux?

kalliste commented 6 years ago

It looks like this may work if you have Wayland and install a (still experimental) Wayland build of Firefox. You should be using Wayland already if you happen to be on a fresh install of Ubuntu 17.10 and you can install Wayland Firefox using Flatpak https://firefox-flatpak.mojefedora.cz/

grahamperrin commented 6 years ago

… WebExtensions can't alter arbitrary preferences.

Mozilla bug 1363856 - [tracker] Implement WebExtensions API to give access to specific preferences

gigitux commented 6 years ago

Have you found a workaround to run firefox on monitor with different dpi?

mcanonic commented 6 years ago

NO, I have bought a new monitor 4k. In the meanwhile I used firefox in just one (of the two) monitor and I have set the layout.css.depixelperpx field in about:config to 3 (or 4). You can also play with the firefox zoom. These solutions work only if you decide ONE SINGLE monitor to be dedicated to firefox. I'm still wondering why firefox did not implement an "auto-zoom" feature.

gigitux commented 6 years ago

Thanks for your answer! :D "In the meanwhile I used firefox in just one (of the two) monitor" Same here!

kalliste commented 6 years ago

@gigitux @mcanonic when I set layout.css.devPixelsPerPx to -1 it seems to do the right thing for me. What is yours set to?

mcanonic commented 6 years ago

My first set was 2, then I set it to 1 for my external monitor. The "-1" does not scale: when I move the firefox wondow from one monitor to the other, I get bad results.

notartom commented 5 years ago

For what it's worth I wrote a WebExtension that does the same thing: https://addons.mozilla.org/en-US/firefox/addon/ffreszoom / https://github.com/notartom/ffreszoom

rubo77 commented 5 years ago

Did you try the extension on Waterfox?

ankitp4t3l commented 3 years ago

For what it's worth I wrote a WebExtension that does the same thing: addons.mozilla.org/en-US/firefox/addon/ffreszoom / notartom/ffreszoom

This doesn't appear to scale the address bar and menus of firefox itself.

layout.css.devPixelsPerPx does.