Commit graph

10558 commits

Author SHA1 Message Date
Dan Stillman
9a49718638 Remove some old Zotero for Firefox code
In particular, remove code related to opening/closing the Zotero pane,
which affects tests. The pane is now opened by default in Firefox, which
brings its behavior closer to the main version.
2019-08-27 00:47:39 -04:00
Dan Stillman
5994e22359 Fx60: Shim XPathResult in translator sandbox
As of Fx60, XPathResult is no longer available as nsIDOMXPathResult in
XPCOM, so just shim its constants, which are all we need, when adding it
to the sandbox.
2019-08-27 00:47:39 -04:00
Dan Stillman
433794916a Fx60: Remove instances of nsILocalFile
nsILocalFile was merged into nsIFile, so either replace it with that or
switch to Zotero.File.pathToFile().
2019-08-27 00:47:39 -04:00
Dan Stillman
6f965251ed Add FilePicker module to replace nsIFilePicker
`nsIFilePicker::show()` is removed in Firefox 60 in favor of `open()`,
which takes a callback (and apparently has been preferred for a long
time).

There's no point switching to that, so this module is a version of
nsIFilePicker with an async `show()` that returns a promise and some
XPCOM-isms replaced (e.g., string paths instead of nsIFile).
2019-08-27 00:47:39 -04:00
Dan Stillman
ee5302f893 Add 'zotero/' prefix for Zotero-specific modules
Pulling from chrome/content/zotero/modules/

This may or may not be what we want to do, but it's better than
intermingling our modules with third-party modules in 'resource/'.
2019-08-27 00:47:39 -04:00
Dan Stillman
c5d404df5e Fx60: Add-on window changes
Legacy/unsigned add-on warnings are now hidden via CSS in the Firefox
build, so remove the code that tries to do that, and instead add a class
to any other warnings so they can be selectively shown.
2019-08-27 00:47:39 -04:00
Dan Stillman
732bb23c33 Fx60: Fix attachment download 2019-08-27 00:47:39 -04:00
Dan Stillman
af7932e59b Fx60: Import Services in hiddenWindow.xul for globalOverlay.js 2019-08-27 00:47:39 -04:00
Dan Stillman
a9d142c83a Fx60: Replace Object.watch() in locateManager 2019-08-27 00:47:39 -04:00
Dan Stillman
3688564c69 Fx60: Fix errors related to Window menu on macOS 2019-08-27 00:47:39 -04:00
Dan Stillman
e50fda90ca Remove obsolete zotero://attachment and zotero://fullscreen 2019-08-27 00:47:39 -04:00
Dan Stillman
76978aa912 Fx60: Fix protocol handler
These will need to be redone for Electron, but this keeps them working
in the meantime.
2019-08-27 00:47:39 -04:00
Adomas Venčkauskas
a8a4d13b72 Fx60: Fix citation dialog height 2019-08-27 00:47:39 -04:00
Dan Stillman
7504086a5e Use modified Firefox executable from zotero-standalone-build in tests 2019-08-27 00:47:39 -04:00
Dan Stillman
d89fe8e80a Fx60: Add extensions.legacy.enabled for tests 2019-08-27 00:47:39 -04:00
Dan Stillman
75daaa3b7c Fix incorrect 'return' in test 2019-08-27 00:47:39 -04:00
Dan Stillman
cde5db463a Fx60: Restore default prefs in tests
Default prefs from legacy extensions don't seem to be used anymore
2019-08-27 00:47:39 -04:00
Dan Stillman
8fa4cc9387 Fx60: Update Zotero.File.iterateDirectory() signature
StopIteration is no longer supported in Firefox 60, so instead of taking
a generator function that might throw StopIteration for the second
parameter, take a function that is passed to iterator.forEach() that
receives an OS.File.DirectoryIterator.Entry for each directory entry. If
the function returns a promise, it's waited for.

Also update other direct uses of OS.File.DirectoryIterator to remove
StopIteration use.
2019-08-27 00:47:39 -04:00
Dan Stillman
f26b1592a3 Fx60: Clear built_in_addons.json file
Though it's not being properly read anyway
2019-08-27 00:47:39 -04:00
Dan Stillman
210c2fcea6 Fx60: Remove obsolete CSS properties 2019-08-27 00:47:39 -04:00
Dan Stillman
77d1c6cf74 Fx60: Fix CSL locale loading 2019-08-27 00:47:39 -04:00
Dan Stillman
ac456ab9bf Fx60: Additional prefs changes for tests 2019-08-27 00:47:39 -04:00
Dan Stillman
0165f75f79 Stub Promise.defer() to avoid the Bluebird deprecation warnings
We should indeed use `new Zotero.Promise`, but we don't need the
warnings for existing code.
2019-08-27 00:47:39 -04:00
Dan Stillman
e736f07ebc Update Travis to 59.0b11 unbranded build 2019-08-27 00:47:39 -04:00
Dan Stillman
8c59df435f Fx60: Fix snapshot filenames
nsIURL doesn't seem to work anymore, so add Zotero.Utilities.parseURL(),
which uses the `url` package from NPM and adds fileName, fileExtension,
and fileBaseName.
2019-08-27 00:47:39 -04:00
Dan Stillman
c07379fe33 Fx60: Fix "path is undefined" in cookie sandbox
getCookiesForURI() seems to now get an nsIURL that won't query to
nsIURI, so look for `filePath` in addition to `path`.
2019-08-27 00:47:39 -04:00
Dan Stillman
6fd879fc16 Fx60: Switch to new XMLHttpRequest() 2019-08-27 00:47:39 -04:00
Dan Stillman
c0da6c0427 Fx60: Add built_in_addons.json file
fetch_xulrunner.sh updates the built-in path to point to this file, but
it's not currently being read properly for some reason (and I'm not sure
it does anything we need).
2019-08-27 00:47:39 -04:00
Dan Stillman
c771d9b046 Fx60: Fix devtools initialization 2019-08-27 00:47:39 -04:00
Dan Stillman
0678f13e96 Use Services for an nsILoginManager initialization 2019-08-27 00:47:39 -04:00
Dan Stillman
8f844251c8 Fx60: Fix access to translator object in sandbox
There's almost certainly other sandbox breakage
2019-08-27 00:47:39 -04:00
Dan Stillman
9ca1014f5b Fx60: Update old-style shorthand function definitions 2019-08-27 00:47:39 -04:00
Dan Stillman
15a7a812f6 Fx60: += operator no longer works on nsIURI spec 2019-08-27 00:47:39 -04:00
Dan Stillman
186d2b0883 Fx60: nsILocalFile -> nsIFile 2019-08-27 00:47:39 -04:00
Dan Stillman
331522b106 Fx60: Update pref handling
- getStringPref/setStringPref are now used for strings instead of
  getComplexValue/setComplexValue
- Remove nsIPrefBranch2 reference
- If there was a pref failure during initialization, nothing was logged
  to the terminal
2019-08-27 00:47:39 -04:00
Dan Stillman
d4b10f1c1e Fx60: Don't try to override toString() on an object 2019-08-27 00:47:39 -04:00
Dan Stillman
0ad308f5f6 Fx60: Update nsIInputStreamPump init() calls 2019-08-27 00:47:39 -04:00
Dan Stillman
78e9db9523 Fx60: Fix issues with JS code modules
- The Mozilla CommonJS loader is no longer available, so bundle the
  Fx52 version of it
- Strict mode is enforced
- `this` is only defined as a global object in .jsm files, not .js files
- `this` can't be converted to a string for BackstagePass test, so check
  for presence of Components.utils.import instead
- The return value from import() is no longer available
2019-08-27 00:47:39 -04:00
Dan Stillman
f7854bfcae Fx60: Remove versioned JavaScript 2019-08-27 00:47:39 -04:00
Dan Stillman
8f00fa2603 Fix missing checkboxes in View menu on Windows (and maybe Linux) 2019-08-22 00:29:29 -04:00
Dan Stillman
17cf605020 Fix empty row in item context menu (regression from bb59429664) 2019-08-22 00:29:29 -04:00
Dan Stillman
8670718ffa Update node-sass for Node 12 2019-08-22 00:29:29 -04:00
Dan Stillman
4e679f513c Update version 2019-08-22 00:29:28 -04:00
Dan Stillman
d63f7c9925 xvfb change for Travis 2019-08-19 05:19:16 -04:00
Dan Stillman
26ee0e294b Update locales from Transifex and merge new English strings 2019-08-19 05:00:50 -04:00
Dan Stillman
bb59429664 Add "Convert Linked Files to Stored Files…" menu option
In new File → Manage Attachments submenu

Closes #1637
2019-08-19 05:00:32 -04:00
Dan Stillman
eca2822651 Update locales from Transifex and merge new English strings 2019-08-12 16:41:29 -04:00
Dan Stillman
3aeef69ad3 Add View menu
The menu includes all user interface options from the General
preferences (now removed from the preferences), toggles for the
collections pane, item pane, and tag selector, and, at long last, a
toggle for recursive collections ("Display Items from Subcollections").

The collections pane and item pane no longer reopen automatically when
restarting Zotero. People might still close them by mistake and not find
this menu, but we'll see how it goes.

Closes #1372
2019-08-12 16:31:31 -04:00
Dan Stillman
6f721098f8 Use Symbol for pref observer deregistration
Zotero.Prefs.registerObserver() now returns a Symbol that can be passed
to Zotero.Prefs.unregisterObserver().
2019-08-12 13:21:18 -04:00
Dan Stillman
eb50067a41 Just use new Date() to parse ISO 8601 dates
This should fix a weird bug where ISO dates were being parsed as a year
earlier.
2019-08-10 08:58:44 -04:00