- Create userdata tables and indexes that are missing
- Delete tables and triggers that should no longer exist
- Run schema integrity check before user data migration
- Run schema integrity check after restart error
This is meant to address two problems:
1) Database damage, and subsequent use of the DB Repair Tool, that
results in missing tables
2) A small number of cases of schema update steps somehow not being
reflected in users' databases despite their having updated userdata
numbers, which are set within the same transaction. Until we figure
out how that's happening, we should start adding conditional versions
of schema update steps to the integrity check.
This is currently only running the update check after a restart error,
which might not occur for all missed schema update steps, so we might
want other triggers for calling setIntegrityCheckRequired().
4bc8fab4f5 added support for `proxy: false` on attachment URLs in
translators, but it made that flag skip `resolveURL()` altogether, which
meant that relative URLs weren't resolved, rather than just skipping
proxying.
This may fix PDF downloads for some ScienceDirect pages (though I can't
test this one):
https://forums.zotero.org/discussion/85884/problem-downloading-pdf-via-zotero
Our SingleFileZ integration would save images inside directories following the
SingleFileZ format. However, Zotero does not support syncing sub-directories of
attachments. This commit switch back to a single HTML file with base64 encoded
resources. We think that the 33% increase in resources will be offset by the
compression of HTML and removal of JavaScript and unused CSS.
This commit does not fix past snapshots that were saved using SingleFileZ.
- Remove TODO comment to add a warning if a Document is passed, since a
document will always be required when operating on something other than
the main page (e.g., for multiples).
- Always return a string instead of null. A translator can always use
querySelector() if it really needs to know if a node exists.
- Automatically trim the returned string
- Add innerText() function that uses .innerText instead of .textContent,
since there are situations where that might be helpful. Some of those we
currently address with trimInternal(), but there can be other
cases where .innerText gives cleaner, user-centric output.
Translators won't be able to rely on these changes for a while, so we'll
need to be careful to watch for problems here, or translators will need
to include a v3 polyfill.
Addresses zotero/translators#1913
Sending value as a string to "removeCreator" breaks the logic in the
loop in that method which is supposed to remove target creator and shift
remaining creators in the array. This in turn triggers undesired removal
of the last creator in the array.
- Use `new URL()`, available in all modern environments, instead of
various other methods. In addition to being consistent and simple,
this allows setting the base URL explicitly, regardless of the
environment.
- Default protocol-relative URLs to 'https' if no document location
(though I'm not sure if that ever happens)
1e0ad3aba changed the test for DB corruption to look for "database disk
image is malformed", but at least Sqlite.openConnection() can throw a
"Could not open connection" error with "2152857611"
(NS_ERROR_FILE_CORRUPTED) in it.