noscript icon indicating copy to clipboard operation
noscript copied to clipboard

[UI] In Cốc Cốc, NoScript popup window can't be opened in Incognito with Tor window

Open SweetSea-ButImNotSweet opened this issue 2 months ago • 4 comments

As the title says. Note that Cốc Cốc Browser provides two types of Incognito windows:

  • Normal Incognito (like in other Chromium-based browsers)
  • Incognito with Tor mode

In the latter, NoScript popup cannot be opened.

Steps to reproduce

  1. Install Cốc Cốc from the official link: https://coccoc.com/en/
  2. Install NoScript as usual, and also set this extension to work in Incognito window
  3. Press Alt + Shift + N to open an Incognito with Tor window.
  4. Wait for Tor to connect successfully. (*)
  5. Visit any random website.
  6. Click the NoScript icon in the address bar or right-click → NoScript.

Expected behavior

The NoScript popup window should appear normally.

Actual behavior

The NoScript popup doesn’t show up at all. When using right-click → NoScript, the following error appears in the console:

browser-polyfill.js:781 Uncaught (in promise) Error: No window with id: 332652123.
    at browser-polyfill.js:781:28
(anonymous)	@	browser-polyfill.js:781

Technical info

Browser:

Cốc Cốc			145.0.162 (Official Build) (64-bit)
Revision		dc9c639a77157fcb1b4d84dbf7ba09e559902ee0
OS				Windows 11 Version 25H2 (Build 26200.6899)
JavaScript		V8 13.9.205.21
User Agent		Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36 coc_coc_browser/145.0.0
Command Line	"C:\Program Files\CocCoc\Browser\Application\browser.exe" --flag-switches-begin --flag-switches-end --origin-trial-disabled-features=CanvasTextNg|WebAssemblyCustomDescriptors

NoScript: 13.2.1

Additional notes:

(*): You can't access any websites when Tor isn’t connected yet. Also, there’s a minor issue where Tor may fail to start properly. You might need to reopen Incognito with Tor multiple times, or even kill all Cốc Cốc and Tor processes via Task Manager before retrying.

The extension still works properly in both Incognito modes.

At the time of writing this report, I’ve also submitted the same issue to the official Cốc Cốc user community on Facebook (“Hội yêu thích Cốc Cốc”), since I’m not sure whether this bug comes from the browser itself or from NoScript. However, that group requires admin approval for every post, so I can’t provide a cross-post link yet. Once my post gets approved, I’ll update this report with the link in a comment.

SweetSea-ButImNotSweet avatar Oct 22 '25 13:10 SweetSea-ButImNotSweet

Update

  • Facebook post: https://web.facebook.com/groups/CocCocGroup/posts/2137712433651832/
  • Also I realized the window tracking of Noscript may have not designed for alternative Incognito window (as it seems when I call Noscript popup in Incognito with Tor window, the popup it appears looks like should only be appeared when I call Noscript popup in normal window)

SweetSea-ButImNotSweet avatar Oct 23 '25 03:10 SweetSea-ButImNotSweet

Update 2

I have made some little additional debugging and found that this issue seems to originate from Cốc Cốc's implementation of its "Incognito with Tor" window, not Noscript itself

When opening only one window Incognito with Tor and closes all any other (except the DevTool one to inspect Noscript's webworker), and run this code below:

(async () => {
  console.log(await browser.windows.getAll()); // []
  console.log(await browser.windows.getCurrent()); // throws
  console.log(await browser.windows.getLastFocused()); // throws
  console.log(await browser.tabs.query({currentWindow:true,active:true})); // []
})();

We get getAll and query both return none, while getCurrent and getLastFocused both throw exception. Noscript still works fine, only the popup cannot be initialized, which implies "Incognito with Tor" window isn't registered properly to windows and tabs APIs

I also tried editing the manifest field from

"incognito": "spanning"

to

"incognito": "split"

and the issue disappeared - NoScript’s popup started working normally again.

This suggests that Cốc Cốc may have broken part of the window registration logic for Tor-mode Incognito windows, causing all browser.windows.* and some browser.tabs.* calls to fail in that context.

I’ve already sent this report update to the Cốc Cốc team (their devs have acknowledged the issue), but I’m posting this here in case it helps NoScript handle this scenario more gracefully or for tracking reference.

SweetSea-ButImNotSweet avatar Oct 23 '25 14:10 SweetSea-ButImNotSweet

For the time being I will keep this issue open for now until new updates

SweetSea-ButImNotSweet avatar Oct 23 '25 14:10 SweetSea-ButImNotSweet

Thank you for your report and your further research. Let's hope Cốc Cốc devs fix their implementation ASAP.

hackademix avatar Oct 23 '25 15:10 hackademix