From fcb6e0c068e090cdadbfd785d11fd59743013fb0 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 31 May 2016 18:03:40 -0400 Subject: [PATCH] Save snapshots via nsIWebBrowserPersist instead of WebPageDump WPD code hasn't been updated in many years, and there was an issue with document permissions in 5.0. We'll need to replace nsIWBP in Electron, but this will do for now. Attachments are opened using file:// URIs instead of zotero://attachment, which is what Standalone does anyway. Ancient HTML annotations and highlights won't be displayed anymore, but I'm not sure they worked anyway, and it hasn't been possible to create them in years. We might be able to write out existing annotations to notes. iframes are skipped during saving, in an attempt to reduce the number of junk ad files. JS can still cause problems with viewing, so we might still want to either disable scripts or force the viewed page offline (if such a thing is possible). There might be issues with auxiliary filename length/characters during cross-platform file syncing. (We modified the WPD code to shorten/clean them.) --- chrome/content/zotero/about.xul | 1 - chrome/content/zotero/webpagedump/common.js | 739 ----------- chrome/content/zotero/webpagedump/domsaver.js | 1091 ----------------- chrome/content/zotero/xpcom/attachments.js | 22 +- .../zotero/xpcom/utilities_internal.js | 45 + chrome/content/zotero/xpcom/zotero.js | 1 - chrome/content/zotero/zoteroPane.js | 2 +- test/tests/attachmentsTest.js | 33 + test/tests/data/snapshot/index.html | 1 + 9 files changed, 85 insertions(+), 1850 deletions(-) delete mode 100644 chrome/content/zotero/webpagedump/common.js delete mode 100644 chrome/content/zotero/webpagedump/domsaver.js diff --git a/chrome/content/zotero/about.xul b/chrome/content/zotero/about.xul index 6f63f2e12..883bc7da5 100644 --- a/chrome/content/zotero/about.xul +++ b/chrome/content/zotero/about.xul @@ -67,7 +67,6 @@