windingwind / zotero-plugin-toolkit

Toolkit for Zotero Plugin Developers.
https://www.npmjs.com/package/zotero-plugin-toolkit
MIT License
104 stars 13 forks source link

Passing a URI to Zotero.File.getContentsAsync() is deprecated -- use Zotero.HTTP.request() instead #22

Closed lifan0127 closed 1 year ago

lifan0127 commented 1 year ago

The use of Zotero.File.getContentsAsync() in the following file seems to cause the deprecation warning as mentioned in the title.

https://github.com/windingwind/zotero-plugin-toolkit/blob/3ac678de032b866c11f0412a74877e4796401949/src/managers/preferencePane.ts#L223

windingwind commented 1 year ago

Thx. This is a known issue.

The uri of plugin resources can be a http uri or a local file uri, depending on how the plugin is loaded. This file API handles automatically.

If we don’t use this API, we’ll have to save a copy of it in the lib. Considering this API is only used in the Z6 compatibility code and there’s no evidence that it will be removed before Z6 comes to its end of support, it’s safe to continue using it.

lifan0127 commented 1 year ago

Okay. Thanks for the explanation!