IndexedDB does not exist in Zotero 7?

105 views
Skip to first unread message

Emiliano Heyns

unread,
May 24, 2024, 7:59:31 PMMay 24
to zotero-dev
IndexedDB doesn't seem to be present in Zotero 7. Is this planned to be present in the release?

XY Wong

unread,
May 28, 2024, 5:10:23 AMMay 28
to zotero-dev
AFAIK, It's available in non-privileged windows and webworkers.

Emiliano Heyns

unread,
May 28, 2024, 1:58:13 PMMay 28
to zotero-dev
Ah OK, in Zotero 6 it was also available in chrome code. But good to know. 

--
You received this message because you are subscribed to a topic in the Google Groups "zotero-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/zotero-dev/ZInyzwez4dU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to zotero-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zotero-dev/86161787-63bb-4dff-b610-718b9be8d322n%40googlegroups.com.

Emiliano Heyns

unread,
May 30, 2024, 6:35:22 PMMay 30
to zotero-dev
When I try

importScripts('resource://gre/modules/Sqlite.jsm')

in a chromeworker, I'm getting

ChromeUtils.import is not a function

any tips on how to load sqlite support (not for the zotero database) from a chromeworker?

Abe Jellinek

unread,
May 30, 2024, 7:06:23 PMMay 30
to zoter...@googlegroups.com
I have a feeling that’s just not supported. You could proxy the specific functions that you need in the worker via messaging.

You received this message because you are subscribed to the Google Groups "zotero-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zotero-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zotero-dev/09f94475-2a41-4cd6-a4ed-7e2ad16bcc93n%40googlegroups.com.

Emiliano Heyns

unread,
May 30, 2024, 7:46:15 PMMay 30
to zotero-dev
I'm trying to cut down on in-memory caches to use less memory. Any chance of indexeddb making a comeback?

XY Wong

unread,
May 30, 2024, 8:43:50 PMMay 30
to zotero-dev
Try `const { IndexedDB } = ChromeUtils.importESModule( "resource://gre/modules/IndexedDB.sys.mjs" );`

(I tried to IndexedDB.open and it works, so probably it would work)

Emiliano Heyns

unread,
May 31, 2024, 3:29:26 AMMay 31
to zotero-dev
Looks like I made a mistake earlier; indexedDB is defined in Zotero 7 ChromeWorker

Emiliano Heyns

unread,
May 31, 2024, 9:15:20 AMMay 31
to zotero-dev
This code doesn't work in the "Run Javascript" window though, I'm getting TypeError: ChromeUtils.importESModule is not a function

On Friday, May 31, 2024 at 2:43:50 AM UTC+2 XY Wong wrote:

Abe Jellinek

unread,
May 31, 2024, 1:47:37 PMMay 31
to zoter...@googlegroups.com
It works fine from the Run JavaScript window for me. Are you not on an fx115 build? (Check Zotero.platformMajorVersion.)

Emiliano Heyns

unread,
Jun 3, 2024, 6:04:05 AMJun 3
to zotero-dev
I was trying it in Zotero 6, sorry. Different question though: indexedDB (and associated entities IDBRequest, IDBTransaction, IDBDatabase, IDBObjectStore, IDBIndex, IDBCursor) are not available in the bootstrap context; I assume because they are traditionally tied to `window`, which the bootstrap doesn't have. But indexedDB is also available in workers, and those don't have a window either.
Reply all
Reply to author
Forward
0 new messages