Duck.ai

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 one website per topic thread (to help keep things organized). While behavior on different sites might at first glance seem similar, they are not necessarily caused by the same.

Please try to 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
GreySkyDawn
Newbie
Newbie
Posts: 4
Joined: 2025-04-10, 08:22

Duck.ai

Unread post by GreySkyDawn » 2025-04-11, 13:42

Site: https://duck.ai

This site used to be working perfectly, but it gained problems in three stages:

Late 2024
Could only work from private mode or by clearing all site data, but otherwise worked well.

From around February/March 2025
Could only work by disabling CSP. Tried from a clean profile, tried keeping CSP but changing its settings from about:config..the only way to make it work was to disable CSP, do the chats that I needed, then enabling it.

From about a week ago
UI shows briefly for a second, then viewport is a completely white screen.

Tested on PM 33.7 & 33.6.1

Error console output (all output from a clean profile, no add-ins)

Code: Select all

Timestamp: 04/11/2025 03:36:38 PM
Warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can remove its sandboxing.
Source File: https://duckduckgo.com/?q=DuckDuckGo+AI+Chat&ia=chat&duckai=1
Line: 0

Timestamp: 04/11/2025 03:36:38 PM
Warning: The character encoding of a framed document was not declared. The document may appear different if viewed without the document framing it.
Source File: blob:https://duckduckgo.com/cffa12ea-9e26-4f8e-ac06-17f40cedd2f2
Line: 0

Timestamp: 04/11/2025 03:37:02 PM
Warning: Use of getPreventDefault() is deprecated.  Use defaultPrevented instead.
Source File: https://duckduckgo.com/dist/lib/l.32113981e35aa54fc221.js
Line: 45
Browser console output:

Code: Select all

ReferenceError: visualViewport is not defined
Stack trace:
yo/<@https://duckduckgo.com/dist/wpm.chat.227034fa144d75d4af83.js:1:192855
j@https://duckduckgo.com/dist/wpmv.7bc357ea1037e5d693b1.js:2:55798
C@https://duckduckgo.com/dist/wpmv.7bc357ea1037e5d693b1.js:2:54569
 Object {  }  
wpm.main.46286da0ad18cc06ccf5.js:1:618585
An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can remove its sandboxing.  
duckduckgo.com
The character encoding of a framed document was not declared. The document may appear different if viewed without the document framing it.  
afdf7fd8-9105-460f-8cb2-afcbf06d49ab

vannilla
Moon Magic practitioner
Moon Magic practitioner
Posts: 2366
Joined: 2018-05-05, 13:29

Re: Duck.ai

Unread post by vannilla » 2025-04-12, 00:14

Appears to be https://developer.mozilla.org/en-US/doc ... alViewport
I don't really know what purpose it serves but it seems it's missing from UXP.

User avatar
jobbautista9
Keeps coming back
Keeps coming back
Posts: 950
Joined: 2020-11-03, 06:47
Location: Philippines

Re: Duck.ai

Unread post by jobbautista9 » 2025-04-12, 07:05

Pretty dirty workaround userscript so that visualViewport is not undefined:

Code: Select all

window.visualViewport = window
function copyInnerSizeToVisualViewport() {
  window.visualViewport.width = window.innerWidth
  window.visualViewport.height = window.innerHeight
}
copyInnerSizeToVisualViewport()
addEventListener("resize", (event) => {copyInnerSizeToVisualViewport()})
This should be able to fix the UI not appearing.
Last edited by jobbautista9 on 2025-04-12, 07:09, edited 1 time in total.
Image

:akko_derp:

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

User avatar
jobbautista9
Keeps coming back
Keeps coming back
Posts: 950
Joined: 2020-11-03, 06:47
Location: Philippines

Re: Duck.ai

Unread post by jobbautista9 » 2025-04-12, 07:07

vannilla wrote:
2025-04-12, 00:14
I don't really know what purpose it serves but it seems it's missing from UXP.
It's pretty much relevant only for mobile browsers, where there are effectively two viewports because of the on-screen keyboard (OSK) being tiled and the browser being able to pinch-zoom content: https://github.com/bokand/bokand.github ... plainer.md
Image

:akko_derp:

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

User avatar
Gemmaugr
Moon lover
Moon lover
Posts: 88
Joined: 2025-02-03, 07:55

Re: Duck.ai

Unread post by Gemmaugr » 2025-04-12, 08:30


User avatar
GreySkyDawn
Newbie
Newbie
Posts: 4
Joined: 2025-04-10, 08:22

Re: Duck.ai

Unread post by GreySkyDawn » 2025-04-13, 06:13

Update: the most recent problem (complete disappearance of UI) was indeed related to visualViewPort, and the grease monkey script in the thread linked to by Gemmaugr solved it. Thanks to everyone who replied!

Now the most pressing problem is needing to disable CSP in order for chat to work. When CSP is enabled it waits a few seconds then says "Duck.ai is temporarily unavailable, please try again later".

Here is the new error log and browser console log, tried with PM 33.7

Error log

Code: Select all

Timestamp: 04/13/2025 08:06:27 AM
Warning: Use of getPreventDefault() is deprecated.  Use defaultPrevented instead.
Source File: https://duckduckgo.com/dist/lib/l.32113981e35aa54fc221.js
Line: 45

Timestamp: 04/13/2025 08:06:27 AM
Warning: An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can remove its sandboxing.
Source File: https://duckduckgo.com/?q=DuckDuckGo+AI+Chat&ia=chat&duckai=1
Line: 0

Timestamp: 04/13/2025 08:06:27 AM
Warning: The character encoding of a framed document was not declared. The document may appear different if viewed without the document framing it.
Source File: blob:https://duckduckgo.com/97f57e92-1a09-4ebf-9a53-da775099b9d2
Line: 0
Browser console

Code: Select all

Use of getPreventDefault() is deprecated.  Use defaultPrevented instead.  
l.32113981e35aa54fc221.js:45:39870

An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can remove its sandboxing.  
duckduckgo.com
The character encoding of a framed document was not declared. The document may appear different if viewed without the document framing it.  
97f57e92-1a09-4ebf-9a53-da775099b9d2

Error:   
wpm.main.19dcbf2a953e01adb66f.js:1:831776
Error: Loading CSS chunk 2434 failed.
(error: https://duckduckgo.com/dist/wpm.feedback-modal.34030b7483a62ed581d0.css)  
wpm.main.19dcbf2a953e01adb66f.js:1:831255

User avatar
GreySkyDawn
Newbie
Newbie
Posts: 4
Joined: 2025-04-10, 08:22

Re: Duck.ai

Unread post by GreySkyDawn » 2025-04-15, 10:05

I've tried to investigate further and came up with this:

1- The chat seems to work correctly on Firefox but it shows two extra messages in its console:

Code: Select all

Content-Security-Policy warnings 2
Content-Security-Policy: Ignoring ‘block-all-mixed-content’ because mixed content display upgrading makes block-all-mixed-content obsolete. duckduckgo.com
Content-Security-Policy: Ignoring ‘x-frame-options’ because of ‘frame-ancestors’ directive.
Content-Security-Policy: Ignoring ‘block-all-mixed-content’ because mixed content display upgrading makes block-all-mixed-content obsolete.
2- Back on Pale Moon, the problem seems to be about an XHR request to https://duckduckgo.com/duckchat/v1/status

When CSP is disabled, this request is made regularly and the chat works correctly. If CSP is enabled, this request is no longer made and chat stops working. If re-disabled that request is made immediately and chat resumes working..

Goodydino
Keeps coming back
Keeps coming back
Posts: 886
Joined: 2017-10-10, 21:20

Re: Duck.ai

Unread post by Goodydino » 2025-04-15, 16:32

How do you disable CSP? Duck.ai works with Waterfox and LibreWolf. Does that mean that those browsers do not have CSP?

User avatar
GreySkyDawn
Newbie
Newbie
Posts: 4
Joined: 2025-04-10, 08:22

Re: Duck.ai

Unread post by GreySkyDawn » 2025-04-16, 21:32

How do you disable CSP? Duck.ai works with Waterfox and LibreWolf. Does that mean that those browsers do not have CSP?
You can disable it from about:config "security.csp.enable" but note that this reduces the security of your browser, you can research online what CSP does exactly.

Waterfox and LibreWolf also have it as it's a standard part of modern browsers, but perhaps implemented differently in some aspects from Pale Moon.
Last edited by GreySkyDawn on 2025-04-16, 21:34, edited 1 time in total.