Zoom

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
User avatar
back2themoon
Moon Magic practitioner
Moon Magic practitioner
Posts: 2369
Joined: 2012-08-19, 20:32

Re: Zoom

Unread post by back2themoon » 2021-09-01, 14:37

As mentioned, NoSquint purposely disables Pale Moon's zoom controls and re-enables them if uninstalled. The "problem" with PM's controls (at least for me) is that they are more susceptible to permanent deletion (accidental or not) either by external cleaners, PM's Clear History tool or some other extension. If you've configured many websites, this is an issue.

I believe zoom settings are stored somewhere in PM's Site Preferences configuration file(s)? These cannot be easily backed up/restored, and I assume include other settings too, unrelated to zoom. NoSquint keeps its settings in prefs.js/about:config, so they are easier to handle.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35474
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Zoom

Unread post by Moonchild » 2021-09-01, 15:27

back2themoon wrote:
2021-09-01, 14:37
I believe zoom settings are stored somewhere in PM's Site Preferences configuration file(s)?
They are. they are saved alongside all other site-specific preferences you may have set (see permissions manager and page info)
back2themoon wrote:
2021-09-01, 14:37
These cannot be easily backed up/restored
Yes they can. Backup your browser profile.
Specifically, it's stored in content-prefs.sqlite if you want to be fine-grained about it. That database store spellcheck language, zoom level, and last-used upload and download directories per site.
back2themoon wrote:
2021-09-01, 14:37
they are more susceptible to permanent deletion (accidental or not) either by external cleaners, PM's Clear History tool or some other extension.
They are no more or less susceptible to permanent deletion than any other user-set data. External cleaners are usually a bad idea to begin with because they are by design sledgehammers (since they won't be using the browser's APIs to do their work). The browser's clear data tool has clear settings for site data. Are you blaming us for PEBCAK?
back2themoon wrote:
2021-09-01, 14:37
NoSquint keeps its settings in prefs.js/about:config, so they are easier to handle.
prefs.js is not designed to store large amounts of data. It is slow and inefficient (and actually more prone to issues than a database is). Although it happens to be human-readable, the "I might lose them" argument isn't in any way less.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
back2themoon
Moon Magic practitioner
Moon Magic practitioner
Posts: 2369
Joined: 2012-08-19, 20:32

Re: Zoom

Unread post by back2themoon » 2021-09-01, 22:09

Thanks for the helpful info. As mentioned, it's a personal preference as I prefer to clearly separate and identify my various backups and settings. I was also thinking about possible profile corruption, whether PEBCAK or not. If content-prefs gets corrupted or needs to be deleted, you are out of luck. You can't extract anything from it (I think).

Yes, backup. Prefs.js is just easier to backup -for me-, that's all. You don't even have to restore all of it.
Moonchild wrote:
2021-09-01, 15:27
prefs.js is not designed to store large amounts of data.
At what point approximately is prefs.js size going to be a problem? Or is it about separate entries within? The NoSquint entries there can get lengthy if many websites are stored, but it's "just" text, right? (131kb currently)

Another cool feature of NoSquint, if a bit esoteric, is the ability to adjust full and text zoom independently and simultaneously. I seem to remember this is not possible with the internal zoom manager (it's either full or text zoom, not both).

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35474
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Zoom

Unread post by Moonchild » 2021-09-02, 14:52

back2themoon wrote:
2021-09-01, 22:09
At what point approximately is prefs.js size going to be a problem? Or is it about separate entries within?
Both, but in fact having very large strings stored in single preferences is much more of a problem than having a gajillion entries, if you want to be specific. Either is a bad idea though.
Note that nothing is stopping extensions from actually using sqlite to store data either. It's all available from within the browser and accessible through APIs.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Quorx
Moon lover
Moon lover
Posts: 88
Joined: 2016-11-28, 16:58
Location: Munich

Re: Zoom

Unread post by Quorx » 2021-09-06, 14:07

Nevertheless, NoSquint has a number of advantages over the built-in option:
• As already mentioned, the magnification factor is visible in the status bar. Most useful if you want to return to original size.
• NoSquint offers the possibility to change only the text size and leave the graphic elements unchanged.
• In addition, you can define exceptions if you do not want the settings to be used for the entire site. If, for example, someone has reduced www.palemoon.org/releasenotes.shtml to 80%, then with PaleMoon’s own zoom function www.palemoon.org is also reduced and (as far as I know) there is no way to handle these pages separately.
• And, as said, NoSquint allows you to define text colours site specific. Very helpful for pages in low-contrast or garish design. If you see that your setting is no good, you can easily switch back to the given display.

Of course, I wouldn't mind if a future PaleMoon had such sophisticated setting options itself...

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35474
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Zoom

Unread post by Moonchild » 2021-09-06, 15:39

Then make sure it's updated before the next release.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4942
Joined: 2015-12-09, 15:45
Contact:

Re: Zoom

Unread post by moonbat » 2021-09-13, 13:00

Quorx wrote:
2021-09-06, 14:07
Of course, I wouldn't mind if a future PaleMoon had such sophisticated setting options itself...
One of the reasons for Pale Moon's efficiency is that the core browser is not bogged down by feature creep of this kind. The whole point of a powerful extension system is that you can extend functionality for those that need it. Not everyone requires this level of fine grained zoom control so makes no sense forcing it on those that don't want it.

Firefox got rid of their extension system and have resorted to stuffing the browser with features out of the box, that does no good for either performance or security (more code = more complexity and larger attack surface for exploits).
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

WiseWolf

Re: Zoom

Unread post by WiseWolf » 2021-09-13, 20:35

"Firefox got rid of their extension system and have resorted to stuffing the browser with features out of the box, that does no good for either performance or security (more code = more complexity and larger attack surface for exploits"
Off-topic:
Try telling that to the free software users who seem to be okay with a bloated system... and other types of users as well.

Redhat has been bloating linux since 2014 and possibly even before that.

I only wish that OpenBSD devs were not so hard to get along with/unreasonable...

They have pretty darn good security supposedly...

Hyperbola has chosen that as a base in the future for a reason I am sure.

1,064,411,236 is how much debian buster has,

OpenBSD has: 33,886,469

It's a shame their leader is easily pissed off, on the smallest of things.

Anywho, my point I guess is, they agree with you on more code = complexity

I compared Debian Buster to OpenBSD 6.5 because both are around the same age.

But yeah, I agree with you Moonbat, I just wish more people did too.

User avatar
Gordon Dry
Fanatic
Fanatic
Posts: 121
Joined: 2014-10-14, 19:54
Location: Germany

Re: Zoom

Unread post by Gordon Dry » 2021-09-24, 20:08

As I edited my version of NoSquint 2.2.2 with all infos found in this thread to a variant that works on my side with Pale Moon 29.4.1 I wonder why the heck it does not work on the rig of my girl friend with the same Pale Moon and the same version of the addon.
It's just the same "non-working" behaviour as mentioned before.
There are those days...

Sessh
Fanatic
Fanatic
Posts: 140
Joined: 2018-01-11, 18:43

Re: Zoom

Unread post by Sessh » 2021-10-22, 03:24

astewart wrote:
2021-08-28, 20:30
Added to FEBE file febe.js:

Code: Select all

// Replacement for deprecated Application.storage
var FEBEstorage = {
	topWin: Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator).getMostRecentWindow("navigator:browser"),
	setItem: function setItem(key, value){
			if(typeof this.topWin.storage == "undefined") this.topWin.storage = {};
			if(key == null || key == "") return false;
			this.topWin.storage[key] = value;
			return true;
	},
	getItem: function getItem(key,dFault){
			if(key == null || key == "") return false;
			if(typeof this.topWin.storage[key] == "undefined") return dFault;
			let value = this.topWin.storage[key];
			return value;
	}
}
Application.storage.get() becomes FEBEstorage.getItem()
Application.storage.set() becomes FEBEstorage.setItem()

WORKS FOR ME but I'm not offering to rigorously test a fork.

Alan
I haven't really done any js editing of this kind and I rely on FEBE for daily backups. Do you add that code anywhere in febe.js or in a certain place?

Am I understanding correctly that:
All instances of Application.storage.get should be changed to FEBEstorage.getItem
All instances of Application.storage.set should be changed to FEBEstorage.setItem

Is that right? Are they the only changes?

User avatar
Figueroa
Moonbather
Moonbather
Posts: 73
Joined: 2021-04-06, 18:32

Re: Zoom

Unread post by Figueroa » 2021-10-22, 03:42

Yes, you make 3 changes to febe.js
Add the code. I put it at the top, under the 3 components variables.
Then 2 search and replaces. There are 29 instances of the 'get' one and 15 of the 'set' one.

The modified FEBE is working for me now, so I think I got it right. Will find out when PM 29.5 comes out.

Sessh
Fanatic
Fanatic
Posts: 140
Joined: 2018-01-11, 18:43

Re: Zoom

Unread post by Sessh » 2021-10-22, 03:47

Yeah. I put it at the top under the version number right above those variables.

I just did a Replace action in Notepad and replaced all the instances. Will this also work in 29.4.1? Can I replace this file now or do I have to wait until 29.5 drops? I don't use the unstables, just trying to be prepared.

User avatar
back2themoon
Moon Magic practitioner
Moon Magic practitioner
Posts: 2369
Joined: 2012-08-19, 20:32

Re: Zoom

Unread post by back2themoon » 2021-10-22, 12:06

It seems more complicated for NoSquint, since init.js and lib.js are within the nosquint.jar file?

Sessh
Fanatic
Fanatic
Posts: 140
Joined: 2018-01-11, 18:43

Re: Zoom

Unread post by Sessh » 2021-10-22, 23:05

I guess it doesn't work with 29.4.1 as the browser won't completely start up if I switch the file in the default profile now, so I guess it's only for when 29.5 arrives.

User avatar
Figueroa
Moonbather
Moonbather
Posts: 73
Joined: 2021-04-06, 18:32

Re: Zoom

Unread post by Figueroa » 2021-10-22, 23:26

It does work for me on PM 29.4.1. One thing I did differently than what I think you did is I removed FEBE completely, downloaded a fresh copy of it, performed surgery, and then installed it. I don't know if that should matter, but I like to change the name of extensions I modify, so that I can tell later which ones are original and which ones I modified. So I change the name in the install.rdf file. Since I am looking to get the new name in the installed list, I haven't tried modding an installed extension. Maybe it doesn't matter, but that process worked for me and the modded FEBE is working as expected.

Sessh
Fanatic
Fanatic
Posts: 140
Joined: 2018-01-11, 18:43

Re: Zoom

Unread post by Sessh » 2021-10-23, 00:21

I downloaded a fresh copy and I see I can explore it using 7zip and find the file.

So, you're saying:

1. Uninstall FEBE (Does it save my current settings to reapply upon re-installation or will I have to do that again?)
2. Download a fresh copy of FEBE and insert the modified febe.js into the xpi to replace the stock one.
3. Install using the modified xpi.

Is that right?

Also edited my install.rdf to reflect that it's a JS mod.

Edit: Same thing happens as when I try to mod the existing extension. PM loads up, but not all the way. It just kinda stops just before it's about to load the previous session, some buttons don't load and my font settings don't load. FEBE shows up, though. I must have did something wrong when editing the JS though not sure what. Restoring the previous profile folder fixes it. Hmm..

Edit: Figured it out! I moved the added lines to where you had them which was under the three component variables instead of above them. That seems to have fixed it, it installed and PM seems to be working fine now as is FEBE. Just did a backup and it went without a hitch.
Untitled.jpg

ky331

Re: Zoom

Unread post by ky331 » 2021-11-09, 12:59

I just updated today, 11/9, to the newest PaleMoon 29.4.2 .
It reduced NoSquint 2.2.2's "magnification" [from 150%] to only 40%... and moreover, I could no longer implement my preferred customizations again... I could write-in the numbers, but hitting OK wouldn't do/save anything. All I could do was x-out the Zooming options screen.

User avatar
fretless
Moongazer
Moongazer
Posts: 7
Joined: 2014-06-14, 22:11
Location: New York State, US

Re: Zoom

Unread post by fretless » 2021-11-09, 13:31

Same here.

User avatar
back2themoon
Moon Magic practitioner
Moon Magic practitioner
Posts: 2369
Joined: 2012-08-19, 20:32

Re: Zoom

Unread post by back2themoon » 2021-11-09, 13:42

Since neither FEBE works, I guess this is FUEL-related? Can't say we haven't been warned, although it'd still be nice to see this in the 29.4.2 release notes.

User avatar
lczlcz
Hobby Astronomer
Hobby Astronomer
Posts: 22
Joined: 2021-03-10, 19:23

Re: Zoom

Unread post by lczlcz » 2021-11-09, 16:47

I have this zoom issue now just after I upgraded to 29.4.2. It can't remember the original zoom setting. I can manually zoom in but when I open a new tab I have to manually do the zoom again.
Can we add a setting in the option for a default zoom level?

Locked