Skip to content

Commit

Permalink
feat: update saveMHTML
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamondYuan committed May 17, 2021
1 parent a42b5e6 commit 4a74b14
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/extensions/contextMenus/saveSelection/saveMHTML.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { IPermissionsService } from '@/service/common/permissions';
import { Container } from 'typedi';
import { VSBuffer } from '@/common/buffer';
import { ContextMenuExtension } from '../../contextMenus';
import pako from 'pako';

Expand All @@ -25,8 +26,9 @@ class ContextMenu extends ContextMenuExtension {
const url = tab.url;
const memory = await mhtml.arrayBuffer();
const view = new Uint8Array(memory);
const value = pako.deflate(view, { to: 'string' });
console.log({ value, title, url });
const value = pako.deflate(view);

console.log({ value: VSBuffer.wrap(value).toString(), title, url });
}

private saveAsMHTML(tabId: number) {
Expand Down

0 comments on commit 4a74b14

Please sign in to comment.