Snapshot resource handler: Use attachmentReaderType

isSnapshotAttachment() checks the link mode (needs to be IMPORTED_URL),
but we actually allow viewing all attachments with text/html MIME types
as "snapshots" in the reader. Don't throw on any HTML attachment that
the reader is willing to open.
This commit is contained in:
Abe Jellinek 2024-05-24 11:25:08 -04:00
parent 2776d21ba0
commit bbde79818f

View file

@ -107,7 +107,7 @@ function ZoteroProtocolHandler() {
.slice(params.groupID !== undefined ? 4 : 3)
.filter(Boolean);
if (resourcePathParts.length) {
if (!item.isSnapshotAttachment()) {
if (item.attachmentReaderType !== 'snapshot') {
return this._errorChannel(`Item for ${uriPath} is not a snapshot attachment -- cannot access resources`);
}