ScienceDirect sometimes puts the `name` directive at the end of the Content-Type
header instead of in Content-Disposition. That isn't strictly spec-approved, but
there are other directives (`charset` and `boundary`) that can also be appended
to Content-Type per the spec. We want to strip them before looking for handlers.
https://forums.zotero.org/discussion/105194/sciencedirect-pdf-downloads-not-working-zotero-7
This was triggering an erroneous warning dialog about a failure to check
for Firefox profiles during Linux tests (where the profile is at
something like /tmp/tmp.l5phnqSxBH/Zotero), but it could also affect a
custom profile directory location.
- Set zotero-noteQuickCopy-menu's preference attribute to the correct key
- Warn about all ID-ish preference attribute values
- zotero-noteQuickCopy-menu's preference attribute was being set to the ID of
a now-nonexistent <preference> element. preference attribute values should
be preference keys now, but we were only warning if the associated
<preference> element was actually there
- We can't warn in all cases where the preference doesn't yet exist, because
some preferences don't have default values, and we shouldn't limit to
preferences that don't exist, because then the warning will stop showing
after the preference is persisted once
- When a <preference> ID is replaced by the associated key, update the
preference attribute so future syncFromPref() and syncToPrefOnModify() calls
will set the correct preference
- Listen to a range of events on all bound nodes, no matter their type
- Don't resolve _firstPaneLoadDeferred until actually done loading
Fixes#3131.
To run a short-lived command and return stdout
The Subprocess module can also start long-running process and
communicate with them, but we'll implement something different for that
if we need it.
(And update the en-US version with some strings that we don't use but
might if we updated to a slightly newer version of the updater before
they got rid of the dedicated update window)
If the file wasn't an XPI at all, or it didn't contain valid metadata for fx102,
the error message would previously show "%S" where the add-on name should be.
Now we fall back to the file path.
So a custom build doesn't have to modify each .ftl file
`app-name` is redundant with the Firefox strings, but it's what we used
previously and is easier to remember.
`nsIWebProgressListener.onStateChange()` gets called twice at the end of
requests, once with `stateFlags` set to `327696` and once with it set to
`262160`, which corresponds to `STATE_STOP + STATE_IS_NETWORK +
STATE_IS_REQUEST` and `STATE_STOP + STATE_IS_NETWORK`. httpd.js debug
logging shows that the connection is closed between the two calls. In
WebProgressFinishListener, we were previously calling `onFinish` after
the first one, but in Zotero 7, at least on Linux (or maybe just on
slower machines due to a race condition), the file from `saveURI()`
doesn't appear to be reliably written after the first call, causing
`Attachments.downloadFile()` to fail in `_enforcePDF()` due to an empty
file.
This changes WebProgressFinishListener to wait until the second
`STATE_STOP` call. We'll have to confirm whether this is the
state-change pattern for all requests, but it fixes our Find Available
PDF tests in CI.
https://firefox-source-docs.mozilla.org/dom/ioutils_migration.html
This also fixes a bug when `getContentsAsync()` is passed an
`nsIInputStream` or `nsIChannel` where raw bytes were returned instead
of a string. Not sure if we're doing that anywhere. If we are, this
would presumably break that code, but the function is supposed to return
a decoded string.
From some 2017-era langpacks I had downloaded. These strings aren't in
current langpacks, which use a different update mechanism, but we're
bundling a modified version of updates.xhtml from Firefox.
All declared Fluent files need to exist for a locale to be used (in a
window?). Since Mozilla code tries to load Fluent files, we need to copy
non-English Mozilla .ftl files to their default effective path (just in
the app omni.ja instead of the toolkit omni.ja).
Fixes#3094
https://forums.zotero.org/discussion/104431/syncing-problem
Replace Online Library can upload annotations created by others in a
group library, so if the upload resulted in a local write, "Cannot edit
item in library" was thrown, since annotations by others aren't
writable. This should've only been a problem if the uploaded data was
actually modified by the server, but we were also checking whether
objects were editable before checking if they had actually changed, so
it would happen for any upload of another person's annotation.
This fixes the order of checks when saving objects and makes an
edit-check exception for saving uploaded data for group annotations.
- Support removeHandler()
- Return DB items from translate() when called with libraryID
- Don't invoke done until attachments are done
Fixes#3084 ("after all" hook still times out, but that happens even if the test
is disabled)
HTML files are now indexed instead of read directly, and indexing was
previous skipped in tests and otherwise performed on a delay, so set a
flag in the affected tests that triggers inline indexing.
Having a single customElements.js file that we import everywhere we need it
helps with organization, and it gives us a single place to put things like the
<tab> fix.
We could switch to using setElementCreationCallback() like Firefox if the number
of imports gets out of hand, but the overhead right now should be small.
Prevents bug in zotero-citation plugin (at least on macOS) from creating
a search that breaks syncing
We were already checking for a missing name in `saveTx()`, but the
plugin is saving the same search twice in rapid succession, the second
time without a name, and the second attempt clears the search object's
name value after the first save's `_initSave()` check and before its SQL
write. The second save fails, but the first save goes through without a
name, resulting in a sync error.
https://forums.zotero.org/discussion/104274/id-1702002152-cannot-synchttps://github.com/MuiseDestiny/zotero-citation/issues/31
It seems that the issue wasn't that zotero:// URLs can't be loaded in a content
browser, but rather that the report extension was returning a channel that the
content browser couldn't access. For some reason, it handled that failure by
passing the URL off to the OS, which then opened a duplicate instance of Zotero.
Also:
- Remove ensureBrowserType() and always use <browser type="content"> in
basicViewer (see b8966f)
- Fix system principal being used to load extensions without `loadAsChrome` set
to true if an extension with `loadAsChrome` set to true had been loaded in the
past
It does not appear to be possible to create a creator with no values in
Mendeley, however we got reports of these causing the imports to fail.
This tweak makes the importer more resilient by discarding empty/invalid
creators.
- Show "More information" link next to relink option
- Automatically check relink option when coming from integration prompt
- Change done message to "[x] items were relinked" instead of "0 items
were imported"
New option only appears if importer version is < 1 or not present.
It will:
* Skip fetching collections and attachments
* Skip any new items
* Update relations on existing items
* Importer will now ask user for a login and password via form and will
perform sign-in directly using credentials rather than oauth
* Signing in this way enables importer to obtain desktop document ID
which is now stored for each item
* It's possible to switch back to the old method (ouath) by setting
`import.mendeleyUseOAuth` pref to `true`.
* New option to only import new items. This options only appears if
database contains previously imported items.
* Importer will now update mendeleyDB:documentUUID on existing items to
match value used in Mendeley Desktop if available
* Importer will no longer create collections when no new items are
imported * Importer will only report number of new items imported on
re-import * Importer will now preserve dateAdded on re-import
Co-authored-by: Dan Stillman <dstillman@zotero.org>
- Windows global styles make .header bold, so we'll override them
- Prefix IDs in <notes-box>
- Give <tags-box> Add button a normal margin
- I think the CSS this removes was meant to apply to tags in the list, not the
Add button, but that's handled elsewhere now
Now all included in `itemFields.`
We still use base-only fields as search conditions, and schema.json
consumers might want to do so as well, so it makes sense to include
them.
This fixes an error using Everything if another library hasn't yet been
loaded and should speed up Everything searches for people with multiple
libraries.
This is sort of an awkward fix, because it doesn't fix the underlying
problem of `addCondition('libraryID', ...)` not working the same as
`.libraryID =` for some search conditions that perform subsearches. But
supporting `addCondition('libraryID', ...)` for those would get
complicated, because there could technically be multiple such
conditions, and applying those to a subsearch that used `AND` would get
messy. So let's just fix the problem at hand.
Fixes#3032
Or at least a way that we already have built-in and that only applies to
the call in `Zotero.Item::migrateExtraFields()`. This doesn't
distinguish between CSL fields (`publisher-place`, `event-place`,
`issued`) and actual Zotero field, and we really only need to skip
the former, but it's fine.
Follow-up to e3cfeee81, related to #3030
Removes a huge amount of excessive files and duplication for CE scss.
All CE css is now output in the single
zotero-react-client.css file.
Moving all CE styling into a single stylesheet required removing their
shadow DOMs. It is desirable anyway, since you want to
be able to style CEs from "outside", when embedding in different
contexts.
Shadow removal required some CE code changes to maintain
functionality.
Elements refactored:
- attachment-box (displayed when an attachment (like PDF) is selected in
the item tree)
- color-picker (in the tag color selector)
- guidance-panel (displayed on first run when editing authors for a book
section)
- item-box (info tab in the item pane)
- note-editor
- notes-box (note tab in the item pane)
- quick-search-textbox
- related-box (related tab in the item pane)
- tags-box (tags tab in the item pane)
- zoterosearch (advanced search condition builder form)
Setting a height/max-height was causing the window not to grow correctly when
rows were added. Whatever the purpose of those styles was in past FF versions,
they're no longer necessary now.
cfbfcf2 changed restore{To,From}Server to restore{To,From}OnlineLibrary and
updated most of the references, but not the ones in preferences_sync_reset.
Other languages still have those strings under the old key names.
- Add 'x' accesskey for "Exit" on Windows
- Show "Quit" instead of "Exit" on Linux
- Don't show Ctrl-Q for shortcut key on Windows
But Ctrl-Q still works on Windows when it shouldn't because of the Mac
keybinding, which still gets registered even if disabled
programmatically in platformKeys.js.
fx102 follow-up to #3010
Well this was a wild one to debug.
Creator fields were only initialized for autocomplete due to a series of
>10-year-old bugs:
1) In `showEditor()`, `Zotero.ItemFields.isAutocompleteField(fieldName)`
was called for creator fields, which would pass, e.g.,
`creator-0-lastName`.
2) In `isAutocompleteField()`, `ItemFields.getName()` would normalize
`creator-0-lastName` to `false`, since it's not a valid field.
3) `isAutocompleteField()` listed `place` as a base field despite its
not having any mapped fields, so when `getTypeFieldsFromBase()` was
called on it, the return value would be `false`, which would be added
to the list of autocomplete fields, which would mean that the
normalized field of `false` from `creator-0-lastName` would match,
which would mean that `isAutocompleteField('creator-0-lastName')`
would always return true...as long as `place` never gained a mapped
field.
Except `isAutocompleteField()` wasn't supposed to be the test for
initializing autocomplete for creator fields anyway -- `fieldName ==
'creator'` was. But `fieldName` is something like `creator-0-lastName`,
not `creator`, which meant that that test always failed, which meant
that if `place` did gain a mapped field, both tests would fail, which
would cause the creator field not to be initialized for autocomplete,
which would cause it to break as soon as you started to type into it.
This fixes that.
Panes were being loaded with Zotero_Preferences as their global scope, so global
variables they defined would be set on that object instead of the window.
The file should follow the same `pref("extensions.foo.bar", "value");`
syntax as files previously in defaults/preferences/, which should no
longer be used in Zotero 7. (For an extension that works in both Zotero
6 and 7, it's OK to have a file in defaults/preferences for Zotero 6 and
an identical prefs.js for Zotero 7.)
Files in defaults/preferences/ aren't automatically loaded when a plugin
is installed/enabled but are still loaded at app startup by Mozilla code
for now. Plugins shouldn't count on that continuing to be the case in
Zotero 7 and should switch to prefs.js.
We'll add a way for bootstrapped plugins to manually trigger reading of
a prefs.js file in Zotero 6.
Using the Headers class from the Fetch API.
Before, the added test would fail: `_requestInternal()`, not finding a header
named `Content-Type` (case sensitive), would set it to
`application/x-www-form-urlencoded`. XMLHttpRequest, upon being given both
`content-type`: `application/json`) and `Content-Type`:
`application/x-www-form-urlencoded`, would helpfully merge the two, producing
`content-type`: `application/json, application/x-www-form-urlencoded`. That's
obviously not the correct behavior.
Limited to a hard-coded list
Initially limited to `extensions.zotero.import.mendeleyUseOAuth`,
to switch the Mendeley importer from direct login to OAuth