Commit graph

12988 commits

Author SHA1 Message Date
Abe Jellinek
a8c4e0637b fx-compat: Restore Mac application menu
The stuff in hiddenWindow.xul doesn't seem to have been doing anything
in Fx102 anyway.
2022-06-27 14:15:11 -04:00
Abe Jellinek
89587e6b76 fx-compat: native="true" on more checkboxes/menulists 2022-06-24 09:11:38 -04:00
Dan Stillman
0120877623 fx-compat: Avoid automatic safe mode from Ctrl-C
Pressing Ctrl-C via the terminal is counted as a crash, and after three
recent crashes automatic safe mode is triggered. In Firefox, this
displays a prompt:

> Firefox closed unexpectedly while starting. This might be caused by
> add-ons or other problems. You can try to resolve the problem by
> troubleshooting in Safe Mode.

For us, that dialog doesn't appear for some reason (maybe we could make
it?) and Zotero just automatically opens in Safe Mode, which causes
state not to be restored and results in an annoying process fork that
breaks Ctrl-C. We might as well keep the automatic-safe-mode behavior
for end users, but we don't want to trigger it while working via the
terminal, so we just clear the recent crash counter when using
`-ZoteroDebug` or `-ZoteroDebugText`. (`extensions.zotero.debug.log`
won't trigger it, so it's best to use `-ZoteroDebugText`, which is
included automatically via the `build_and_run` script.)
2022-06-23 05:42:57 -04:00
Dan Stillman
3805f901cf fx-compat: Fix centering of library pane progress bar 2022-06-23 04:17:08 -04:00
Dan Stillman
f827b9ef50 fx-compat: initKeyEvent()new KeyboardEvent()
Quick Format change is untested
2022-06-21 03:31:58 -04:00
Dan Stillman
587ae6ba7e fx-compat: Fix blurring of textarea fields in item box
And fix tests
2022-06-21 03:03:37 -04:00
Dan Stillman
563f91bf18 Rename zoteroIntlTest.js to intlTest.js 2022-06-21 01:39:31 -04:00
Dan Stillman
3743c179e1 Add missing commonDialog.js from dictionary manager
Currently provides close-on-Esc functionality
2022-06-21 01:39:07 -04:00
Dan Stillman
bbdcb92042 Add missing test data files 2022-06-21 01:39:07 -04:00
Dan Stillman
20945f60c9 fx-compat: Remove nsIURI.clone() usage 2022-06-21 01:39:07 -04:00
Dan Stillman
6297d0862f fx-compat: Replace last use of getURLSpecFromFile()
Follow-up to 8f7a160ba1

Untested, since it's in the prefs -- we'll have to see if this works
after #2659
2022-06-21 01:39:00 -04:00
Dan Stillman
789a8a5fe9 fx-compat: Use new mozILocaleService API
Replace functions with arrays, as in https://phabricator.services.mozilla.com/D6339
2022-06-20 23:09:46 -04:00
Dan Stillman
6e43d2cd4e fx-compat: Fix tags-box tests 2022-06-20 23:02:09 -04:00
Dan Stillman
3a5c24b6f1 fx-compat: Fix some tag selector tests 2022-06-20 19:32:03 -04:00
Dan Stillman
54529ab461 fx-compat: Pass dialog as second argument to waitForDialog() in tests
Makes it easier to run dialog.getButton(), etc.
2022-06-20 19:30:28 -04:00
Dan Stillman
96f6b871ce fx-compat: Fix sync error panel 2022-06-20 18:43:09 -04:00
Dan Stillman
842e100b73 Additional assertion for sync test from d0c1a1f600 2022-06-20 18:43:02 -04:00
Dan Stillman
d0c1a1f600 fx-compat: Fix sync test involving waitForDialog()
`waitForDialog()` now returns a regular window, and
`window.document.documentElement.textContent` includes all form
elements, so this updates a test to include the checkbox label.
2022-06-20 17:47:15 -04:00
Martynas Bagdonas
5b879f75c5 fx-compat: Avoid dead object errors in note-editor
Fixes #2663
2022-06-20 11:33:10 +03:00
Dan Stillman
b3077182d2 fx-compat: Fix Zotero.MIME.getMIMETypeFromURL()
Replace

```
Components.classes["@mozilla.org/network/standard-url;1"]
	.createInstance(Components.interfaces.nsIURL)
```

with

```
Services.io.newURI(url).QueryInterface(Ci.nsIURL);
```
2022-06-20 01:12:57 -04:00
Dan Stillman
30f636274b Update Notifier ids for itemBox/notesEditor custom elements 2022-06-20 00:47:50 -04:00
Dan Stillman
5bc1b6ad81 Update tests for itemBox/noteEditor custom elements 2022-06-20 00:47:50 -04:00
Dan Stillman
be3b245dbe Don't index PDF if fulltext.textMaxLength is 0
Follow-up to 13adfd131c
2022-06-19 19:03:41 -04:00
Dan Stillman
df3e7a600e Update Zotero.File.getContentsAsync() tests 2022-06-19 18:59:01 -04:00
Dan Stillman
dfff86df72 fx-compat: Fix Zotero.File.download() 2022-06-19 18:58:25 -04:00
Dan Stillman
8f7a160ba1 fx-compat: getURLSpecFromFile()Zotero.File.pathToFileURI()
One remaining instance in the prefs that will need to be fixed
2022-06-19 15:20:54 -04:00
Dan Stillman
f8aa14d431 fx-compat: Fix feed test using Array.map() 2022-06-19 15:09:23 -04:00
Dan Stillman
fa2ad2f234 loadBrowserWindow() → loadZoteroWindow() in feed test 2022-06-19 15:07:41 -04:00
Dan Stillman
408453c9e9 fx-compat: Fix dictionaries tests 2022-06-19 04:16:53 -04:00
Dan Stillman
eb67adb257 fx-compat: Add ChromeUtils as eslint global 2022-06-19 04:16:53 -04:00
Dan Stillman
4a3ff46bd7 fx-compat: Fix waitForWindow()/waitForDialog() in tests 2022-06-19 04:16:53 -04:00
Abe Jellinek
d2dbf959b6 fx-compat: Restore old row highlight color on macOS
https://github.com/zotero/zotero/pull/2660#issuecomment-1159384470
2022-06-18 17:50:52 -05:00
Abe Jellinek
9c69f73de5 Manually remove handler instead of using once
Since we only want to remove if the target matches.
2022-06-18 03:45:32 -04:00
Abe Jellinek
a48ebe2dd7 Show native menus from toolbar 2022-06-18 03:45:32 -04:00
Abe Jellinek
a60e46dd5c fx-compat: Fix toolbar 2022-06-18 03:45:32 -04:00
Abe Jellinek
dd3385ec67 Revert "fx-compat: Remove Mac toolbarbutton images"
This reverts commit 280a1265c8.
2022-06-18 03:45:32 -04:00
Dan Stillman
d90334e883 fx-compat: Initial nsIWebBrowserPersist.saveURI() fixes
Will need additional fixes for cookie handling, etc., but this at least
fixes the signature
2022-06-17 20:29:01 -04:00
Dan Stillman
2b41b0127c Get binary contents in Zotero.File.getSample()
And fix magic numbers for content-type sniffing, which wrongly used the
Unicode replacement character (which likely just meant we were falling
back to file-extension-based detection)
2022-06-17 20:29:01 -04:00
Dan Stillman
13adfd131c fx-compat: Update full-text indexing
Use the new PageData mechanism for character set detection, don't try to
index HTML files directly without properly detecting the charset, and
generally simplify the indexing code.

HTML files are now considered cached files that require indexing and
won't be indexed automatically in Zotero.FullText.findTextInItems(),
which breaks certain expectations, including in some tests. This will
need to be addressed.
2022-06-17 20:29:01 -04:00
Dan Stillman
1dd24f7082 Remove Zotero.File.getCharsetFromFile()/addCharsetListener()
Unused in over a decade, and now replaced by the PageData actor
2022-06-17 20:29:01 -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
Dan Stillman
7f748b2620 Take path or nsIFile in Zotero.File.pathToFileURI() 2022-06-17 20:24:43 -04:00
Dan Stillman
41dd75af8a Wait for Zotero.init() before returning Zotero.reinit()
Not sure if this makes a difference, but it seems more correct.
2022-06-17 20:24:43 -04:00
Dan Stillman
0dd088e98d Add loadZoteroWindow() support function for tests
`loadBrowserWindow()` will need to be updated for loading remote URLs,
but anything needing a Zotero window (including `loadZoteroPane()`) can
use this.
2022-06-17 20:24:43 -04:00
Dan Stillman
730e86d661 fx-compat: Restore tests and test using actual Zotero executable
The test runner now uses the Zotero executable from
`zotero-standalone-build/staging` rather than the Firefox from
`zotero-standalone-build/xulrunner`. Along with testing the actual
program, this restores visible UI updates during tests, which should
make debugging various things easier. We can also now remove anything
related to Zotero being an extension.

Many tests are still broken, but this at least lets us start running
them.
2022-06-17 20:24:43 -04:00
Dan Stillman
5d08359dc9 fx-compat: Update httpd.js from mozilla-central 1739f130 2022-06-17 20:24:43 -04:00
Dan Stillman
3c9dcea46b Add comment explaining CSS rule to hide menuitem icons on macOS 2022-06-17 20:24:43 -04:00
Abe Jellinek
0e1a16b96b fx-compat: Show native field/creator transform popups
No longer anchored to the element, but instead to the cursor.
2022-06-17 18:49:07 -05:00
Abe Jellinek
c31df4ae6b fx-compat: Display item box using CSS grid
- Widths are now correct
- Rows are a little too tall
- Field value vertical alignment is off
- Platform styling isn't done and some styles might be redundant
- Still can't scroll vertically
- Creator name inputs still displayed wrong
2022-06-16 16:27:16 -05:00
Dan Stillman
f454944f8c fx-compat: Fix files not showing up in debugger 2022-06-16 04:19:41 -04:00