New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[not-issue] usage with SingleFile #1
Comments
You are welcome! Thanks for your testing report of SingleFile. |
FYI, SingleFile also includes an annotation editor to do the same thing without installing any additional extension. |
That's great! I think the SingleFile's annotation editor is very suitable for common cases. In fact, I often use SingleFile and other tools to save different kinds of html files depend on which tool can satisfy what I want to keep data. For example, I wanna keep image source address from original remote site, so I simply use the internal saving facility of browser to save html files. |
I confirm the editor cannot remove margins. The use case I have in mind is rather the removal of ads and other unwanted elements while keeping the style. However, the editor also allows to save the page as it appears in the reader mode. I think this feature could be suitable for your needs. |
Oh, the SingleFile's reader mode is my ever seen best read mode, it works perfectly in 99% cases. By the way, I think you already know there are some problems about the reader mode:
The first problem can be overcomed by using "force enable reader mode" extensions. |
Actually, SingleFile uses the Firefox implementation for the reader mode, see https://github.com/mozilla/readability. I agree that the reader mode might be too destructive for your use case. BTW, I added a link to your project here: https://github.com/gildas-lormeau/SingleFile/blob/master/README.MD#projects-usingcompatible-with-singlefile |
That's a very useful clue! I might investigate something interesting about the reader mode.
It's my honor for my project to be added to SingleFile's compatible list. This means a lot to me. |
Can you support Mozilla Archive Format that generated by SignleFileZ? Thanks~ @gildas-lormeau Catch ya! :) |
Hmm, I think this plugin is not available to open the HTML files generated by SingleFileZ. I am new to SingleFileZ web extension, therefore I tried to parse the file generated by it(e.g.: abc.zip.html) and a standard .maff (Mozilla Archive Format) file. Refer to this .maff file https://www.amadzone.org/mozilla-archive-format/maff-test-cases/test-basic-type-html.maff, it is a pure ZIP file, and its content starts with "PK" string following by standard ZIP binary code. By the contrast, the abc.zip.html is a pure HTML file, and its content looks like The SingleFileZ project declare it "save a webpage as a self-extracting HTML file", I think it explain many things. If you really want to see the content of compressed HTML files in Obsidian, I think the simplest way is to re-save them by original SingleFile browser extension to plain text HTML files. |
@nuthrash Files produced by SingleFileZ are not pure HTML files. These are invalid HTML files (the HTML specification does not allow embedding binary data as is in the markup) but 100% valid zip files in fact. Indeed, the zip specification does not require a zip file to begin with "PK". It allows to store some random data before (and after) the zip data. I know that because I'm the author of zip.js, see https://github.com/gildas-lormeau/zip.js. |
@gildas-lormeau The Obsidian has blocked such Javascript operations in external files (such as .html .md, etc.) by default. I've confirmed it by the most dangerous function
I have some questions:
|
It is unfortunately necessary to install SingleFileZ to view pages from the filesystem in Chromium-based browsers because they don't allow to run
The file can be unzipped and it contains an
The function import { extract } from "https://raw.githubusercontent.com/gildas-lormeau/SingleFileZ/master/src/single-file/processors/compression/compression-extract.js";
import * as zip from "https://raw.githubusercontent.com/gildas-lormeau/zip.js/master/index.js";
globalThis.zip = zip;
async function extractPage(zipBlob) {
const { docContent } = await extract(zipBlob, { noBlobURL: true });
return docContent;
} You can also use local imports instead of retrieving scripts from |
Hi.
Just wanna drop in and say thank you. I'm using SingleFile to archive some website into a single html file. Now with your plugin, I can view the archived html file from within Obsidian. Not counting the fact that these notes have also their own metadata in frontmatter, which is awesome.
The text was updated successfully, but these errors were encountered: