Commit graph

15 commits

Author SHA1 Message Date
Dan Stillman
512a2444d8 Add timeout to HiddenBrowser::getPageData()
The queries wait for the document to be ready, so a page that never
finished loading would hang the caller -- e.g., full-text indexing --
forever.
2026-07-24 13:11:50 -04:00
Dan Stillman
3a54a5ecb1 Fix allowJavaScript option in HiddenBrowser
allowJavaScript: false didn't disable scripts for a system-principal
document, such as a blob: URL created from chrome code, which runs
scripts regardless of the allowJavascript flag. Sandbox the document
instead, forcing a null principal and blocking script execution.
2026-07-24 13:11:50 -04:00
Abe Jellinek
ece2b59700 fx140: More progress toward startup 2025-07-30 22:18:36 -04:00
Adomas Venčkauskas
67b5a0bb19 Use the bundled mozilla httpd (#5148) 2025-04-22 09:47:58 -04:00
Abe Jellinek
93b677aaf4
Fix HiddenBrowser test failures (#5134)
Wait for 'complete', not 'interactive', so we know the image has been
loaded.

And use single documentIsReady() implementation instead of copy-pasting.
2025-03-20 23:32:02 -04:00
Abe Jellinek
a96b7f1b68 HiddenBrowserTest: Don't test HTML served as attachment
Something funky is going on with Content-Disposition: attachment on
displayable content in fx128. It's correctly blocking the download, but
we're no longer getting a STATE_STOP notification when that happens.
The HTML test didn't really test anything different from the
octet-stream one, so we can just remove it.

Fixes #4881
2024-12-14 01:16:02 -05:00
Abe Jellinek
bd9048861c HiddenBrowser: Test download blocking
9b7d3edbb3
2024-05-07 11:17:30 -04:00
Abe Jellinek
5263c79ea8 BlockingObserver: Re-enable in CI 2024-04-11 22:59:48 -04:00
Dan Stillman
bef389e110 CI: Temporarily disable BlockingObserver test due to #3962 2024-04-11 05:58:51 -04:00
Abe Jellinek
64b8c7b250
SingleFile actor: Skip cross-origin frames to fix error (#3721) 2024-02-21 06:43:45 -05:00
Adomas Ven
8b77c96e97
Displays a browser window to clear captcha when saving attachments. (#3526)
- Currently enabled only for ScienceDirect. Can be enabled via a whitelist
- Matches the HiddenBrowser loaded HTML page for a captcha element. If
  the captcha element class changes, this will break (but the
  alternative is potentially displaying a captcha clearing window when
  something else that is not a captcha guard is loaded).
- Captcha clear timeout for 60s.
- Doesn't automatically switch focus back to the browser which intiated
  the item save via the Connector.
- Stores the cookies used to clear the captcha for future saves from the
  same domain. Discards Connector supplied User Agent, since CF bot
  detector checks UA header against actual UA behavior like TLS handshake
  and if the UA acts different to what it's supposed to, the bot
  challenge is not cleared.

Other changes:
- Adjusted the cookie sandbox to allow multiple cookie sandboxes to be
  active (and simplified some legacy code that was meant to cover a bug
  in old FX codebase).
- HiddenBrowser API changed to be Object oriented, translator tester
  in the translate repo will need to be updated after a merge (have the
  change ready).
- Improved Connector Server attachment progress handling
2023-12-27 04:43:50 -05:00
Abe Jellinek
2639981dda
Block remote content when indexing HTML file (#3157) 2023-06-12 23:43:18 -04:00
Abe Jellinek
0612a9e6f5 fx-compat: Run translation and SingleFile in [hidden] browser
And replace loadDocuments().
2023-04-14 11:44:44 -04:00
Abe Jellinek
4b99b2715d fx-compat: HiddenBrowser: Add more options
- Make docShell properties configurable
- Allow requiring a successful HTTP status code
2023-04-14 11:43:48 -04:00
Dan Stillman
6a2949be8a fx-compat: Add HiddenBrowser.jsm
Remove Zotero.Browser and add HiddenBrowser.jsm. Post-Fission, web/file
content loads in a separate process, so it's not possible (as best as I
can tell) to directly access the contents of a hidden browser -- it just
appears as about:blank in the parent process. We now use Mozilla's
JSWindowActor mechanism [1] to get page data, including character set
and body text for full-text indexing. We'll have to evaluate other uses
of hidden browsers to see how to handle them.

This also adds include.jsm for loading the Zotero object into a JSM.

[1] https://firefox-source-docs.mozilla.org/dom/ipc/jsactors.html
2022-06-17 20:28:58 -04:00