FritzOS 7.39 Labor fails Browser check - seems to be Bigint related

For support with specific websites

Moderator: trava90

Forum rules
Please always mention the name/domain of the website in question in your topic title.

Please try and include any relevant output from the Toolkit Error Console or the Developer Tools Web Console using the following procedure:
  1. Clear any current output
  2. Navigate or refresh the page in question
  3. Copy and paste Errors or seemingly relevant Warnings into a single [ code ] block.
User avatar
mifritscher
Moongazer
Moongazer
Posts: 10
Joined: 2021-01-21, 11:44

FritzOS 7.39 Labor fails Browser check - seems to be Bigint related

Unread post by mifritscher » 2022-10-22, 11:32

Operating system: Ubuntu 20.04
Browser version: 31.3.0.1
32-bit or 64-bit browser?: 64 bit
Problem URL: (Fritzbox is a popular router family from AVM, sorry, no public URL available)
Browser theme (if not default): Default
Installed add-ons: -
Installed plugins: (about:plugins): "No installed plugins found "

I just installed FritzOS 7.39 (Labor) on a Firtzbo 7590. They conduct following test whether the browser is suitable:

Code: Select all

var ok = true;
var nbc = gNbc || false;
try {
    if (!nbc) {
        ok = ok && window.Proxy && typeof new window.Proxy({}, function() {}) === "object";
        ["1"].forEach(function() {});
        ok = ok && window.Promise && typeof new window.Promise(function() {}) === "object";
        ok = ok && window.Blob && typeof new window.Blob(["<a></a>"], {
            type: "text/html"
        }) === "object";
        ok = ok && window.requestAnimationFrame && true;
        ok = ok && window.Promise.resolve(true).finally(function() {});
        ok = ok && (typeof window.BigInt("1") === "bigint");
    }
} catch (err) {
    ok = false;
}
if (!ok) {
    window.location.href = "sorry.lua";
}
I annotated it a bit to get more debug info:

Code: Select all

  function s() {
    var ok = true;
    document.write("ok1 " + ok);
    ok = ok && window.Proxy && typeof new window.Proxy({}, function() {}) === "object";
    document.write("ok2 " + ok);
    ["1"].forEach(function() {});
    document.write("ok3 " + ok);
    ok = ok && window.Promise && typeof new window.Promise(function() {}) === "object";
    document.write("ok4 " + ok);
    ok = ok && window.Blob && typeof new window.Blob(["<a></a>"], {
      type: "text/html"
    }) === "object";
    document.write("ok5 " + ok);
    ok = ok && window.requestAnimationFrame && true;
    document.write("ok6 " + ok);
    ok = ok && window.Promise.resolve(true).finally(function() {});
    document.write("ok6 " + ok);
    ok = ok && (typeof window.BigInt("1") === "bigint");
    document.write("ok7 " + ok);
  }
  s();
Result:

Code: Select all

ok1 trueok2 trueok3 trueok4 trueok5 trueok6 trueok6 [object Promise] 
Log:

Code: Select all

TypeError: window.BigInt is not a function
So it seems BigInt is missing.

A current chrome says:

Code: Select all

ok1 trueok2 trueok3 trueok4 trueok5 trueok6 trueok6 [object Promise]ok7 true

I did not dig further, but I think BigInt is used for creating the new WireGuard Keys on the client or something similar. Or for efficient IPv6 arithmetic.

User avatar
mifritscher
Moongazer
Moongazer
Posts: 10
Joined: 2021-01-21, 11:44

Re: FritzOS 7.39 Labor fails Browser check - seems to be Bigint related

Unread post by mifritscher » 2022-10-22, 12:04

Hmm, sorry, I could swear I put it into the "Web Compatibility Support" forum. Sorry for that :-(

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 33309
Joined: 2011-08-28, 17:27
Location: Tranås, SE
Contact:

Re: FritzOS 7.39 Labor fails Browser check - seems to be Bigint related

Unread post by Moonchild » 2022-10-22, 13:20

We can't really do anything about firmware vendors not being browser agnostic in their proprietary router web admin interfaces.
There's likely no reason whatsoever for FritzOS to rely on BigInt, to begin with, but considering it deals with varying local addresses there is literally nothing that can be done, other than filing a complain with the fritzbox vendor.
"The best revenge is to not be like the person who wronged you." -- Marcus Aurelius
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb

User avatar
mifritscher
Moongazer
Moongazer
Posts: 10
Joined: 2021-01-21, 11:44

Re: FritzOS 7.39 Labor fails Browser check - seems to be Bigint related

Unread post by mifritscher » 2022-10-23, 06:30

As I said; I think that BigInt is used to create cryptographic material on the client side for which the builtin crypto functions in JS are not suitable.

I mean, it has functions for IPSec, Wireshark and creating / importing SSL certs.

And probing for BigInt _is_ browser vendor agnostic. I would blame AVM if there test e.g. the browser agent, but they don't. They probe functions which they need.

(To be honest, I hated JS for long time to have only a FP number format, which has its own load of problems...)

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 33309
Joined: 2011-08-28, 17:27
Location: Tranås, SE
Contact:

Re: FritzOS 7.39 Labor fails Browser check - seems to be Bigint related

Unread post by Moonchild » 2022-10-23, 07:21

mifritscher wrote:
2022-10-23, 06:30
As I said; I think that BigInt is used to create cryptographic material on the client side for which the builtin crypto functions in JS are not suitable.

I mean, it has functions for IPSec, Wireshark and creating / importing SSL certs.
You don't need BigInt for any of that unless you choose to rely on it. In fact we have cryptographic features specifically for creating/importing SSL certs (keygen, etc.). In addition, this worked just fine in the previous version o their firmware, right? so... aside from an arbitrary decision, was there a major change to the feature set? Probably not...
Of course we can argue all day about the hypothetical and practical use of BigInt but ultimately it's Fritz's choice to make this OS change and Fritz's decision to no longer be compatible as a result.
mifritscher wrote:
2022-10-23, 06:30
And probing for BigInt _is_ browser vendor agnostic. I would blame AVM if there test e.g. the browser agent, but they don't. They probe functions which they need.
That's not what I meant. I didn't mean to say their test isn't browser agnostic, but their hard reliance on BigInt is. As a result they deny you access to your hardware from Pale Moon, IIUC? In what way is that them being browser agnostic? Once more, did they make a big change in feature set that would hard require BigInt for things you do in Fritz?
"The best revenge is to not be like the person who wronged you." -- Marcus Aurelius
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb

User avatar
mifritscher
Moongazer
Moongazer
Posts: 10
Joined: 2021-01-21, 11:44

Re: FritzOS 7.39 Labor fails Browser check - seems to be Bigint related

Unread post by mifritscher » 2022-10-23, 08:45

Actually, WireGuard _is_ new in this version - and it is quite possible that this uses crypt which the builtins do not provide.

And, all major engines (Firefox, Chrome and Safari) do support this since a long time. So I'm afraid that more and more pages will depend on this...

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 33309
Joined: 2011-08-28, 17:27
Location: Tranås, SE
Contact:

Re: FritzOS 7.39 Labor fails Browser check - seems to be Bigint related

Unread post by Moonchild » 2022-10-23, 19:40

Wireguard doesn't require BigInt at all. Look it up.
In fact, WireGuard could just piggyback on existing C implementations present in our NSS library (x25519, ChaCha20, Poly1305, and basic implementation of hashing functions), if it was actually used by the web UI directly, which is extremely unlikely.
It is unlikely to be required in any way for communication between the browser and the web interface of a router, as that would inevitably be something internal to the firmware talking to the hardware. It is therefore likely FritzOS simply uses a transcription configuration or library dependency which is relying on BigInt arbitrarily (which I can't say for sure without spending time with a Fritzbox in person, which won't happen)

You can draw your own conclusions if you like about the necessity of BigInt in JavaScript for web interface interactions -- I just ask that you properly inform yourself about the technologies before jumping to conclusions. Once again, we have no control over the proprietary firmware or its dev's decisions, and you as a Fritzbox customer would be the best person to contact them as it impacts your use directly. I'm sorry if Pale Moon is not meeting your needs at this point but as always, I suggest people use what works best for them.

That said, if you feel Pale Moon should have BigInt support on the short term, we welcome contributions to extend our JS engine with it.
"The best revenge is to not be like the person who wronged you." -- Marcus Aurelius
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb

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

Re: FritzOS 7.39 Labor fails Browser check - seems to be Bigint related

Unread post by back2themoon » 2022-12-06, 23:30

Official/stable 7.50 update landed - no longer Pale Moon compatible.
changelog wrote:
**Improved** New design and improved operation concept for logging in to the FRITZ!Box user interface
**Improved** Revised layout of the FRITZ!Box user interface
**Improved** Changed operating concept for changing settings in the user interface

The FRITZ!Box user interface has been visually refreshed with the new version. Particularly noticeable here is the separation of the menu from the left edge of the screen and the width of the displayed pages have been trimmed for better readability. This has a positive effect on tables and texts, especially when displayed on particularly large screens (resolutions), and at the same time improves the display on smartphones and tablets. The redesign is based on a new style guide that facilitates the integration of innovative operating concepts.
None of this makes any actual sense... :roll:

I'm only seeing this warning in the Error Console:

Content Security Policy: Ignoring ‘x-frame-options’ because of ‘frame-ancestors’ directive

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 33309
Joined: 2011-08-28, 17:27
Location: Tranås, SE
Contact:

Re: FritzOS 7.39 Labor fails Browser check - seems to be Bigint related

Unread post by Moonchild » 2022-12-07, 09:57

Can't really do anything without actual info.
Send me a Fritzbox so i can check it out? XD
"The best revenge is to not be like the person who wronged you." -- Marcus Aurelius
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb

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

Re: FritzOS 7.39 Labor fails Browser check - seems to be Bigint related

Unread post by back2themoon » 2022-12-07, 16:24

You are welcome to a TeamViewer connection, if it's any help.

User avatar
Kand_in_Sky
Fanatic
Fanatic
Posts: 103
Joined: 2013-01-02, 18:22
Location: DE

Re: FritzOS 7.39 Labor fails Browser check - seems to be Bigint related

Unread post by Kand_in_Sky » 2023-01-15, 16:34

back2themoon wrote:
2022-12-06, 23:30
Official/stable 7.50 update landed - no longer Pale Moon compatible.
confirm, changing browser user agent does not help
btw, FritzOS 7.50 needs icons, so style is complete broken if you have choose not to allow it, but thats another story
PaleMoon & Basilisk
- on 2014 i5-4210M Notebook 8GB Win7 64Bit
- on 2014 Athlon 5350 16GB PC Win7 64Bit
- on 2018 Athlon200GE 32GB PC Win10 64Bit

User avatar
Kris_88
Lunatic
Lunatic
Posts: 426
Joined: 2021-01-26, 11:18

Re: FritzOS 7.39 Labor fails Browser check - seems to be Bigint related

Unread post by Kris_88 » 2023-01-17, 02:54

Try this:
https://fritz.box/?nbc=1
Workarounds

browser.js is included by content.lua, login.lua and surf.lua. It is accessible at https://fritz.box/js/browser.js.
To defeat the Browser-Check you can create a custom filter for this URL in your favourite adblocker.

Starting with firmware 6.36 you can defeat the Browser-Check by calling https://fritz.box/?nbc=1. (nbc = no browser check)
This will set the gNbc variable (global no browser check, see below) from box.get.nbc in index.lua and no further checks occur for this session.
Alternatively index.lua also supports the POST method to set the gNbc variable from box.post.nbc.

A third method replacing a possibly missing window.Promise.prototype.finally() method with a greasemonkey userscript containing a polyfill is explained here.
Using polyfills for missing methods would be a way better approach for FRITZ!OS than browser.js and sorry.lua. :)
https://boxmatrix.info/wiki/Browser-Check#Workarounds
https://www.ip-phone-forum.de/threads/u ... 644/page-6

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

Re: FritzOS 7.39 Labor fails Browser check - seems to be Bigint related

Unread post by back2themoon » 2023-01-17, 15:37

Kris_88 wrote:
2023-01-17, 02:54
Try this: https://fritz.box/?nbc=1
Thank you for the tip. fritz.box won't connect here, simply used 192.x.x.x/?nbc=1 instead.

No "browser incompatible" message appears, just a blank screen. Error Console:

SyntaxError: import declarations may only appear at top level of a module
Source File: http://192.x.x.x/js/main.js
Line: 177, Column: 128
Source Code:
ox,"new-ui-elements");const script="/"+lib.pages[newPid].js;import(script).then((module)=>{if(newPid===lib.currentPid){i

Line 177:

Code: Select all

function loadJsPage(fromPid,newPid,addParams={}){jsl.addClass(gMainBox,"new-ui-elements");const script="/"+lib.pages[newPid].js;import(script).then((module)=>{if(newPid===lib.currentPid){if(module?.default){currentPageModule=module.default;if(currentPageModule.init){lib.delContent();currentPageModule.init(newPid,addParams);}else{throw new Error(`Missing init-Method in "${newPid}" Page-Module.`);}}else{throw new Error(`JS-File "${lib.pages[newPid].js} is not an ES-Module.`);}}}).catch((err)=>{console.error("Error loading '"+script+"' with error:"+err);if(!addParams.noRetry){lib.changePage(null,fromPid,{noRetry:true});}else{doLogout(true);}});}

User avatar
Kris_88
Lunatic
Lunatic
Posts: 426
Joined: 2021-01-26, 11:18

Re: FritzOS 7.39 Labor fails Browser check - seems to be Bigint related

Unread post by Kris_88 » 2023-01-17, 18:07

Oh my God! This is just a router, but you have to dance around it with a tambourine... :D
Apparently, the developers forgot what and for what purpose they do...

User avatar
pale guru
Apollo supporter
Apollo supporter
Posts: 36
Joined: 2021-11-06, 11:10
Location: Tyskland

Re: FritzOS 7.39 Labor fails Browser check - seems to be Bigint related

Unread post by pale guru » 2023-01-29, 20:35

AVM sometimes have their own strange implementation of rules, ie. only allowing a-z and 0-9 for creating the WiFi password hash just because the example code in the reference does not implement anything else.

At least AVM could test BigInt with some try … catch so their router software would not fail silently.

NB: Is there support for BigInt in Pale Moon planned for the future, or, from a programmer's perspective, why not?
… tanning in dimmed LCD light. – Evry 1′s a beginner, baby, that's the truth…

User avatar
Nigaikaze
Board Warrior
Board Warrior
Posts: 1258
Joined: 2014-02-02, 22:15
Location: Chicagoland

Re: FritzOS 7.39 Labor fails Browser check - seems to be Bigint related

Unread post by Nigaikaze » 2023-01-29, 21:22

pale guru wrote:
2023-01-29, 20:35
Is there support for BigInt in Pale Moon planned for the future
There's an issue open for it in the repo (UXP #1240), but very little progress has been made towards implementing it yet.
Nichi nichi kore ko jitsu = Every day is a good day.

Post Reply