Print Edit not working in Pale Moon 28 Topic is solved

General discussion, compatibility and contributed extensions.

Moderators: FranklinDM, Lootyhoof

User avatar
0strodamus
Fanatic
Fanatic
Posts: 112
Joined: 2014-11-19, 19:48
Location: US

Print Edit not working in Pale Moon 28

Post by 0strodamus » 2018-08-24, 02:56

Has anyone been able to get Print Edit working with Pale Moon 28? I've tried many versions between 1.5 and 18.4 without success. I've also searched this forum and online, but haven't found anything of interest. The Browser Console shows the following errors:

Code: Select all

16:16:04.161 TypeError: $(...) is null 1 printPreviewBindings.xml:171:11
	initialize chrome://global/content/printPreviewBindings.xml:171:11
	onEntered chrome://global/content/printUtils.js:594:7
16:17:08.816 TypeError: box is null 1 printedit-framescript-edit.js:520:21
I've looked at the extension's code, but so far that has been a fruitless endeavor. Any help would be appreciated!
archlinux | OpenRC | TOMOYO Linux | Xfce

"In his house at R'lyeh dead Cthulhu waits dreaming."

palem
Moonbather
Moonbather
Posts: 53
Joined: 2018-02-08, 16:12

Re: Print Edit not working in Pale Moon 28

Post by palem » 2018-08-24, 12:34

For me, Print Edit (18.4) works, but with errors.
It was possible to edit the sample page and save it as a PDF, but then there were problems closing the page of this extension. And when finally I manged it, re-use of Print Edit was not possible and Pale Moon had to be restarted to use Print Edit again.

riiis
Lunatic
Lunatic
Posts: 457
Joined: 2014-05-17, 15:51
Location: USA

Re: Print Edit not working in Pale Moon 28

Post by riiis » 2018-08-24, 14:54

0strodamus wrote:Has anyone been able to get Print Edit working with Pale Moon 28? I've tried many versions between 1.5 and 18.4 without success.
Print Edit works with a wide range of Firefox versions (Firefox 4.0 - 56.* ). To do so, Print Edit must first determine the browser version that is running, and then apply the code appropriate for that respective version. For example, a search for "ffversion", in Print Edit files, results in 183 hits in 6 "js" and "xml" and "css" files. Since Pale Moon versions (say "pmversion") do not track with Firefox versions ("ffversion"), Print Edit may be applying code, designed for an incompatible version of Firefox, to Pale Moon 28.

User avatar
therube
Board Warrior
Board Warrior
Posts: 1319
Joined: 2018-06-08, 17:02

Re: Print Edit not working in Pale Moon 28

Post by therube » 2018-08-24, 15:49

Off-topic:
Nuke Anything Enhanced may provide similar functionality.
A bit updated version, https://drive.google.com/file/d/1coRh30 ... sp=sharing.
Might see if that works, for you, in PM?

riiis
Lunatic
Lunatic
Posts: 457
Joined: 2014-05-17, 15:51
Location: USA

Re: Print Edit not working in Pale Moon 28

Post by riiis » 2018-08-24, 18:17

Print Edit 18.4 appears to be aware of Pale Moon and to be compatible, explicitly, with Pale Moon 27. And also, Print Edit 18.4 does not appear to process Pale Moon 28 as different from Pale Moon 27. For example, Print Edit's "printedit-browser.js" file includes 17 references to Pale Moon, including the following:

Code: Select all

ffPaleMoon: false, //line 100
if (printEdit.appInfo.name == "Pale Moon") printEdit.ffPaleMoon = true; //line  481
if (printEdit.ffVersion >= +"36.0" || (printEdit.ffPaleMoon && printEdit.ffVersion >= +"27.0")) navToolbox = PrintUtils._listener.getNavToolbox(); // line 1251 
else navToolbox = PrintUtils._callback.getNavToolbox(); // line 1252
if (printEdit.ffVersion >= +"36.0" || (printEdit.ffPaleMoon && printEdit.ffVersion >= +"27.0")) printPreviewTB.deinitialize(); // line 1254
Perhaps the developers of Print Edit, if contacted by users, would update Print Edit for changes, that were made in PM28 from PM27.

Galaxy
Hobby Astronomer
Hobby Astronomer
Posts: 29
Joined: 2016-07-04, 03:41

Re: Print Edit not working in Pale Moon 28

Post by Galaxy » 2018-08-24, 20:41

While waiting to find out if Print Edit will be updated for Pale Moon 28, I can report that Print Edit 18.4 works great in Basilisk.

User avatar
0strodamus
Fanatic
Fanatic
Posts: 112
Joined: 2014-11-19, 19:48
Location: US

Re: Print Edit not working in Pale Moon 28

Post by 0strodamus » 2018-08-25, 20:59

Thanks for the responses and suggestions. Hopefully someone will figure out how to get this extension working again. If I can accomplish that myself, I'll be sure to update this thread.
archlinux | OpenRC | TOMOYO Linux | Xfce

"In his house at R'lyeh dead Cthulhu waits dreaming."

Bito_MUC
Apollo supporter
Apollo supporter
Posts: 39
Joined: 2015-06-17, 10:03
Location: Munich (Germany)

Re: Print Edit not working in Pale Moon 28

Post by Bito_MUC » 2018-09-03, 18:05

I have informed the developer of "Print Edit" (dw-dev) via E-Mail that the extension is not compatible with Pale Moon 28 and asked him to eventually fix it. Here is his answer:
I am aware that my Firefox legacy add-ons are (largely) compatible with Pale Moon, although I have never officially supported Pale Moon. Over the last 18 months I have spent a lot of time developing new WebExtensions add-ons to replace all of my legacy add-ons, including Print Edit. These new extensions are also designed to work on Chrome, Opera, Vivaldi, etc. I am no longer actively supporting my legacy add-ons on Firefox or Pale Moon. I expect the vast majority of Firefox users to eventually migrate to Firefox Quantum or to Chrome.
Unfortunately, I am not a programmer but only a stupid user, but maybe someone else here is able to fix the incompatibility?
Else it would be nice if Pale Moon's printing function itself had similar options.

Falna
Lunatic
Lunatic
Posts: 361
Joined: 2015-08-23, 17:56
Location: UK / France

Re: Print Edit not working in Pale Moon 28

Post by Falna » 2018-09-03, 19:28

Off-topic:
therube wrote:Nuke Anything Enhanced may provide similar functionality.
It's what I use for similar purposes, and working without problem (v1.1.1-signed.1-signed)

ltcomdata
Hobby Astronomer
Hobby Astronomer
Posts: 15
Joined: 2015-06-28, 03:49
Location: WI

Re: Print Edit not working in Pale Moon 28

Post by ltcomdata » 2018-09-12, 22:51

If the extension "works great in Basilisk", perhaps there is hope that when all the bugs are fixed in Pale Moon 28 we will once again have use of this fantastic add-on? That is my hope anyway.

User avatar
0strodamus
Fanatic
Fanatic
Posts: 112
Joined: 2014-11-19, 19:48
Location: US

Re: Print Edit not working in Pale Moon 28

Post by 0strodamus » 2018-09-13, 03:06

I've found that printedit-browser.js returns the following ffVersion and ffPaleMoon variables.

Code: Select all

Basilisk: ffVersion=52.0 and ffPaleMoon=false
Pale Moon 27: ffVersion=27 and ffPaleMoon=true
Pale Moon 28: ffVersion=28 and ffPaleMoon=true
I've tried forcing ffVersion=52.0 and ffPaleMoon=false globally and at various places in the code to find the magic combination for Pale Moon 28, but no luck so far.
archlinux | OpenRC | TOMOYO Linux | Xfce

"In his house at R'lyeh dead Cthulhu waits dreaming."

User avatar
0strodamus
Fanatic
Fanatic
Posts: 112
Joined: 2014-11-19, 19:48
Location: US

Re: Print Edit not working in Pale Moon 28

Post by 0strodamus » 2018-10-06, 01:55

I got Print Edit 18.4 working with Pale Moon 28+, by making the following changes to /chrome/content/printedit-browser.js. :clap:

find (line 449):

Code: Select all

if (printEdit.versionComparator.compare(printEdit.appInfo.version,"55.0a1") >= 0) printEdit.ffVersion = "55.0";
replace:

Code: Select all

if (printEdit.versionComparator.compare(printEdit.appInfo.version,"28.0") >= 0  && printEdit.appInfo.name == "Pale Moon") printEdit.ffVersion = "52.0";
        else if (printEdit.versionComparator.compare(printEdit.appInfo.version,"55.0a1") >= 0) printEdit.ffVersion = "55.0";
find (line 1356):

Code: Select all

if (printEdit.ffVersion >= +"51.0")
replace:

Code: Select all

if (printEdit.ffVersion >= +"51.0" && !printEdit.ffPaleMoon)
diff:

Code: Select all

diff '--color=auto' -aur a/chrome/content/printedit-browser.js b/chrome/content/printedit-browser.js
--- a/chrome/content/printedit-browser.js	2017-08-14 16:26:00.000000000 -0700
+++ b/chrome/content/printedit-browser.js	2018-10-05 18:43:13.280948179 -0700
@@ -446,7 +446,8 @@
         
         /* Determine Firefox version and set attribute */
         
-        if (printEdit.versionComparator.compare(printEdit.appInfo.version,"55.0a1") >= 0) printEdit.ffVersion = "55.0";
+		if (printEdit.versionComparator.compare(printEdit.appInfo.version,"28.0") >= 0  && printEdit.appInfo.name == "Pale Moon") printEdit.ffVersion = "52.0";
+        else if (printEdit.versionComparator.compare(printEdit.appInfo.version,"55.0a1") >= 0) printEdit.ffVersion = "55.0";
         else if (printEdit.versionComparator.compare(printEdit.appInfo.version,"54.0a1") >= 0) printEdit.ffVersion = "54.0";
         else if (printEdit.versionComparator.compare(printEdit.appInfo.version,"53.0a1") >= 0) printEdit.ffVersion = "53.0";
         else if (printEdit.versionComparator.compare(printEdit.appInfo.version,"52.0a1") >= 0) printEdit.ffVersion = "52.0";
@@ -1353,7 +1354,7 @@
             
             /* Make edit browser active */
             
-            if (printEdit.ffVersion >= +"51.0")
+            if (printEdit.ffVersion >= +"51.0" && !printEdit.ffPaleMoon)
             {
                 /* Print preview will now be initiated from the edit browser, instead of the source browser */
                 /* Any mozPrintCallbacks will now go to the edit browser, instead of the source browser */
archlinux | OpenRC | TOMOYO Linux | Xfce

"In his house at R'lyeh dead Cthulhu waits dreaming."

Bito_MUC
Apollo supporter
Apollo supporter
Posts: 39
Joined: 2015-06-17, 10:03
Location: Munich (Germany)

Re: Print Edit not working in Pale Moon 28

Post by Bito_MUC » 2018-10-07, 18:31

Hi Ostradamus,

thank you for your professional work to make PrintEdit run again on Pale Moon 28.*
I did the two changes within the file printedit-browser.js within the xpi (as good as I have understood your recipe -- I am really not a software developer) and installed the fixed xpi as usual via the add-ons window, but unfortunately, the extension does not work with my Pale Moon 28.1.0, 64 Bit (German locale): Whenever I click "Edit" in the File/Print Preview menu, I get this error message:
Printedit_Error.png
Printedit_Error.png (5.51 KiB) Viewed 1970 times
Additionally, I cannot close the PrintEdit window and go back to the normal view of the website. Instead the browser closes and I have to start Pale Moon again.
:cry:

(sorry for my English, this is not my mother tongue)

User avatar
0strodamus
Fanatic
Fanatic
Posts: 112
Joined: 2014-11-19, 19:48
Location: US

Re: Print Edit not working in Pale Moon 28

Post by 0strodamus » 2018-10-08, 00:22

Sorry what I posted is not working for you. I'm using Linux and your screenshot looks like Windows. Maybe that is making the difference. I really have no idea and a quick look through the code again yielded nothing obvious. I'm not a developer either and you calling my hack "professional work" made me smile. :D

The changes I made are basically trying to give Print Edit a browser versioning in Pale Moon 28 that matches Basilisk where the extension is working fine. I determined that by adding the following 2 changes to the code in printedit-browser.js:
find:

Code: Select all

else printEdit.ffVersion = "4.0";
replace:

Code: Select all

else printEdit.ffVersion = "4.0";
console.log("printEdit.ffVersion: " + printEdit.ffVersion);
find:

Code: Select all

if (printEdit.appInfo.name == "Pale Moon") printEdit.ffPaleMoon = true;
replace:

Code: Select all

if (printEdit.appInfo.name == "Pale Moon") printEdit.ffPaleMoon = true;
console.log("printEdit.ffPaleMoon: " + printEdit.ffPaleMoon);
Now when you launch Pale Moon, you can open the Browser Console and see what Print Edit is given by the browser. If you try this and your values are not ffVersion=52.0 and ffPaleMoon=true, then you didn't make the first change correctly. If this is good, then I would double-check the second change is correct. I wish I had more to offer and I do hope you get this extension working on your system too.
archlinux | OpenRC | TOMOYO Linux | Xfce

"In his house at R'lyeh dead Cthulhu waits dreaming."

Bito_MUC
Apollo supporter
Apollo supporter
Posts: 39
Joined: 2015-06-17, 10:03
Location: Munich (Germany)

Re: Print Edit not working in Pale Moon 28

Post by Bito_MUC » 2018-10-08, 10:03

Thank you for your fast reply. You are right: My Pale Moon is running under Windows (Win 7 prof, 64 Bit), and so (for me) it is not surprising that your hack for a linux system perhaps does not solve my problem.
Despite that, I did all the four changes that you have recommended in your last two posts, started the browser console, set the filter to "printedit-browser", clicked "Edit" in the File/Print Preview menu, and this is what I got (in addition to the error message of my last post):
Printedit_Browserconsole 2.png
Perhaps you are able to interprete the informations delivered there?

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 27422
Joined: 2011-08-28, 17:27
Location: 58°2'16"N 14°58'31"E
Contact:

Re: Print Edit not working in Pale Moon 28

Post by Moonchild » 2018-10-08, 11:44

"CustomizableUI" is an Australis paradigm. It does not exist in Pale Moon. It's likely that parts of the extension need to be rewritten for Pale Moon use.
"There will be times when the position you advocate, no matter how well framed and supported, will not be accepted by the public simply because you are who you are." -- Merrill Rose
Image

User avatar
0strodamus
Fanatic
Fanatic
Posts: 112
Joined: 2014-11-19, 19:48
Location: US

Re: Print Edit not working in Pale Moon 28

Post by 0strodamus » 2018-10-08, 23:48

Thanks for the additional information. It appears that you made the first code change correctly. I'm not sure how to double-check the second change I posted earlier. There is a comment just above the correct line with "/* Make edit browser active */" if that helps to double-check.

You should be able to get rid of the CustomizableUI errors by adding a third edit to the printedit-browser.js code. I've tested the following change here, but as this isn't affecting Linux I'm seeing no difference. Hopefully, this change will fix things for you in Windows.
find:

Code: Select all

if (printEdit.ffVersion >= +"29.0")
replace:

Code: Select all

if (printEdit.ffVersion >= +"29.0" && !printEdit.ffPaleMoon)
The find code appears twice in printedit-browser.js. The first instance is at line 531 in the original file and is the one to change. You'll see CustomizableUI in the if statement just below the line to change (in the other instance at line 1486 you'll see zoom in the if statement below).

Give this a try and let me know if it works.
archlinux | OpenRC | TOMOYO Linux | Xfce

"In his house at R'lyeh dead Cthulhu waits dreaming."

Bito_MUC
Apollo supporter
Apollo supporter
Posts: 39
Joined: 2015-06-17, 10:03
Location: Munich (Germany)

Re: Print Edit not working in Pale Moon 28

Post by Bito_MUC » 2018-10-09, 09:14

Hi Ostradamus,

you got it!! If the file printedit-browser.js is changed at each of the five positions you found, I can run "Print Edit" in my Pale Moon v. 28.* in the way it was intended.
Thank you, thank you, thank you!
:D :clap:

Perhaps it would be an idea to put the "hacked" xpi to https://addons.palemoon.org/extensions/, so that other people don't need to do the changes themelves (after they eventually would have found this thread), and to mark the problem as "solved"?

User avatar
back2themoon
Board Warrior
Board Warrior
Posts: 1733
Joined: 2012-08-19, 20:32

Re: Print Edit not working in Pale Moon 28

Post by back2themoon » 2018-10-09, 09:33

Bito_MUC wrote:Perhaps it would be an idea to put the "hacked" xpi to https://addons.palemoon.org/extensions/, so that other people don't need to do the changes themelves (after they eventually would have found this thread), and to mark the problem as "solved"?
viewtopic.php?f=46&t=13655
Safe Mode / clean profile info: Help/Restart in Safe Mode
Information to include when asking for support - How to apply user agent overrides
How to download videos

Windows 10 Pro • Pale Moon x64 • Interlink x64 • Emsisoft Anti-Malware

User avatar
0strodamus
Fanatic
Fanatic
Posts: 112
Joined: 2014-11-19, 19:48
Location: US

Re: Print Edit not working in Pale Moon 28

Post by 0strodamus » 2018-10-09, 20:39

Bito_MUC wrote:Hi Ostradamus,

you got it!! If the file printedit-browser.js is changed at each of the five positions you found, I can run "Print Edit" in my Pale Moon v. 28.* in the way it was intended.
Thank you, thank you, thank you!
:D :clap:
That's great! You're very welcome and I'm glad I was able to help you.
Last edited by 0strodamus on 2018-10-09, 20:39, edited 1 time in total.
archlinux | OpenRC | TOMOYO Linux | Xfce

"In his house at R'lyeh dead Cthulhu waits dreaming."

Locked