Dorando keyconfig - Add a new key - Page Style changing Topic is solved

Add-ons for Pale Moon and other applications
General discussion, compatibility, contributed extensions, themes, plugins, and more.

Moderators: FranklinDM, Lootyhoof

User avatar
MisterMisanthrope
Newbie
Newbie
Posts: 6
Joined: 2024-08-01, 04:19

Dorando keyconfig - Add a new key - Page Style changing

Unread post by MisterMisanthrope » 2025-01-17, 07:41

I'm looking for a way to quickly change Page Style under View and though I could use Dorando keyconfig but I don't know what Code Source I'm looking for to enter in able to do so.

User avatar
jars_
Lunatic
Lunatic
Posts: 413
Joined: 2016-12-27, 00:12

Re: Dorando keyconfig - Add a new key - Page Style changing

Unread post by jars_ » 2025-01-17, 09:37

Code: Select all

  getMarkupDocumentViewer().authorStyleDisabled ? gPageStyleMenu.switchStyleSheet('') : gPageStyleMenu.disableStyle();

User avatar
MisterMisanthrope
Newbie
Newbie
Posts: 6
Joined: 2024-08-01, 04:19

Re: Dorando keyconfig - Add a new key - Page Style changing

Unread post by MisterMisanthrope » 2025-01-18, 03:21

Amazing. Thanks! :thumbup:

I binded it to Ctrl+Alt+PgDn, works perfectly to hot swap back and forth between "No Style" and "Basic Page Style"

Cheers

User avatar
Bilbo47
Lunatic
Lunatic
Posts: 295
Joined: 2017-11-18, 04:24

Re: Dorando keyconfig - Add a new key - Page Style changing

Unread post by Bilbo47 » 2025-01-18, 19:45

jars_ wrote:
2025-01-17, 09:37

Code: Select all

getMarkupDocumentViewer().authorStyleDisabled ? gPageStyleMenu.switchStyleSheet('') : gPageStyleMenu.disableStyle();
Where might this kind of thing be documented? Like an API for UPX... Not-knowing what is possible/available under the hood becomes a barrier when trying to write an Add-on. Or when *using* an Add-on, in the case of Dorando.

User avatar
jars_
Lunatic
Lunatic
Posts: 413
Joined: 2016-12-27, 00:12

Re: Dorando keyconfig - Add a new key - Page Style changing

Unread post by jars_ » 2025-01-19, 03:22

Not-knowing what is possible/available under the hood becomes a barrier when trying to ...
Thats soo true! SfMBE (G translate ↓)
Well, for this Moonchild&CO made a non-standard archive for palemoon.res, so that it could not be unpacked and viewed by any archiver - “all for the convenience of the interested user" :wtf:

Let me be clear: it is inexperienced users who find it difficult. The first time I contacted a specialist, he unpacked this archive for me. Those. they did shit to people like you and me, but not to “evil hackers” :thumbdown:

To detect and compose the code above, you need: CustomButtons(ext) + Attribute Inspector(CB button by Infocatcher) + DOM inspector(ext).
1. Attrib.insp. highlights the menu item and shows called functions(click btn and hover mouse ).
2. CTRL+SHIFT+I or MMC (hotKeys Ai) will open a menu item in the DOM inspector where you can find references...
3. If nothing found in DOM insp, then in CB we write code like this (we took hints of what to look for from Ai + DOMi):

Code: Select all

 alert(gPageStyleMenu.toSource());
Run and copy the code into AkelPad or Notepad++ and look at the code, take what we need. Trying, testing ...
Profit!11! :coffee:
SfMBE (G translate ↓)
---
Ну, для этого Moonchild&CO и сделали нестандартный архив для palemoon.res , чтоб ни одним архиватором его нельзя было распаковать и посмотреть - "всё для удобства заинтересованного пользователя" :wtf:
Давайте поясню: именно неопытным пользователям это доставляет трудности. Первое же обращение к специалисту и он мне распаковал этот архив. Т.е. нагадили именно таким как ты и я, но никак не "злобным хаккерам" :thumbdown:

Что бы обнаружить и составить код вышеприведённый, нужно: CustomButtons(ext) + Attribute Inspector(CB button by Infocatcher) + DOM inspector(ext).

1. Attrib.insp. подсвечивает пунк меню и показывает вызываемые функции
2. CTRL+SHIFT+I or MMC (hotKeys Ai) откроет в DOM inspector пункт меню, где можно будет найти отсылки...
3. И если ничего на найдено в DOM insp то в CB пишем код типа такого(намеки что искать, мы взяли из Ai + DOMi):

Code: Select all

 alert(gPageStyleMenu.toSource());
Копируем код в блокнот и смотрик по коду, берем что нам нужно. Пробуем, смотрим...
Profit!11!

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

Re: Dorando keyconfig - Add a new key - Page Style changing

Unread post by Moonchild » 2025-01-19, 08:02

jars_ wrote:
2025-01-19, 03:22
Well, for this Moonchild&CO made a non-standard archive for palemoon.res, so that it could not be unpacked and viewed by any archiver - “all for the convenience of the interested user" :wtf:
You are still upset about this? Talk about holding a grudge!...

Repeating once more since it's been a while: It's not an archive. It may have started out in the Netscape days as a java archive (.jar) format but it isn't. There's a reason Mozilla changed the extension of it aeons ago to avoid confusion about it being a standard archive or not. The issue with unpacking with an archiver is because of its compression scheme, but even without that no longer being "zip-compatible" the resource file isn't an archive. Brotli is simply decompressing faster (improving browser startup) and more compact (reducing file size) to use for compressing a resource file that is primarily source code/text.
If you want to know the browser's source code, check the repo. You can find everything that makes up the browser UI in palemoon/base/content
The fact that you're unhappy about no longer being able to apply dirty hacks by editing the .res (=resource) file as if it was an archive (in turn destroying the optimized layout -- you can be lucky it has ever been able to be read by the browser afterwards! The fact the browser understands a standard zip archive in its place has been a "happy accident" because it needs to be able to read .jar files as well for historical reasons e.g. for old extensions) isn't a reason to twist it as if the only reason for further optimizing the speed and size of it was to "make it inconvenient for advanced users". Advanced users can use git or the web interface to the source via repo.palemoon.org and inspect the browser source there.
"The world will not be destroyed by those who do evil, but by those who watch them without doing anything." - Albert Einstein
"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
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 36969
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Dorando keyconfig - Add a new key - Page Style changing

Unread post by Moonchild » 2025-01-19, 10:44

Right, I had forgotten about that :) -- so, see, Jars? No need to be prickly about it, a resource file viewer is available if looking at the source is too complicated.
"The world will not be destroyed by those who do evil, but by those who watch them without doing anything." - Albert Einstein
"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
UCyborg
Lunatic
Lunatic
Posts: 293
Joined: 2019-01-10, 09:37
Location: Slovenia

Re: Dorando keyconfig - Add a new key - Page Style changing

Unread post by UCyborg » 2025-01-24, 08:50

MozJAR Recompressor also exists, lets you unpack and repack.

Post Reply