A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
clipper(web): make ready for publishing
Abdullah Atta47dcbba52223
diff --git a/extensions/web-clipper/build-utils/manifest.js b/extensions/web-clipper/build-utils/manifest.jsindex 22b6851eb..de51f9289 100644--- a/extensions/web-clipper/build-utils/manifest.js+++ b/extensions/web-clipper/build-utils/manifest.js@@ -33,7 +33,7 @@ const ACTION = {const common = {name: "Notesnook Web Clipper",- version: "1.0",+ version: "0.1",description: "Clip web pages.",permissions: ["activeTab",@@ -42,7 +42,6 @@ const common = {"contextMenus","notifications"],- key: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmXQb9xwsSWbvAbBVnWa+DwsXLtRLbjfLyWRZtT5KF8bjCrEg3InvntWlk1PrNo73lsTov1m8Y5K9fJcCVKuYZkTCmNf4iGsHqOafi9ny5MX53oQ53+/s7gao2ZicHtTylnCIqn8f/l+RkV3tHO8BwANDLX2TTe7zCYLzFH19jiKAI+7qmUDZvyCH/OMVohluUCQO94s7sghslalwPbAcQQLpAKxYdd5GJDn4FryitsCMTYX962X+O6Tivq2QPML/Gm7BrZqJsU1enFRH1ss0UK0b9COpEYqqPhZ+GJP5K6WOL46NX+CvZnQmux1ehTZgIhw64IQJ57TvG2kIQTA8ZQIDAQAB",content_scripts: [{js: ["nnContentScript.bundle.js"],diff --git a/extensions/web-clipper/tsconfig.json b/extensions/web-clipper/tsconfig.jsonindex 878ce51df..b0d4ce68d 100644--- a/extensions/web-clipper/tsconfig.json+++ b/extensions/web-clipper/tsconfig.json@@ -5,8 +5,7 @@"allowJs": true,"jsx": "react-jsx","maxNodeModuleJsDepth": 5,- "declaration": false,- "noEmit": true+ "declaration": false},"include": ["src", "global.d.ts"]}diff --git a/packages/clipper/src/clone.ts b/packages/clipper/src/clone.tsindex a62510cf8..803f9d7d9 100644--- a/packages/clipper/src/clone.ts+++ b/packages/clipper/src/clone.ts@@ -293,8 +293,10 @@ function clonePseudoElements(}function copyUserInput(original: HTMLElement, clone: HTMLElement) {- if (original instanceof HTMLTextAreaElement) clone.innerHTML = original.value;- if (original instanceof HTMLInputElement)+ if (+ original instanceof HTMLInputElement ||+ original instanceof HTMLTextAreaElement+ )clone.setAttribute("value", original.value);}diff --git a/packages/clipper/src/index.ts b/packages/clipper/src/index.tsindex 721bb7b0a..e2f4d620c 100644--- a/packages/clipper/src/index.ts+++ b/packages/clipper/src/index.ts@@ -429,10 +429,9 @@ function getElementViewportInfo(el: HTMLElement) {}function toDocument(head: HTMLElement, body: HTMLElement) {- const newHTMLDocument = document.implementation.createHTMLDocument();- newHTMLDocument.head.outerHTML = head.outerHTML;- newHTMLDocument.body.outerHTML = body.outerHTML;- return newHTMLDocument;+ const doc = document.implementation.createHTMLDocument();+ doc.documentElement.replaceChildren(head, body);+ return doc;}function cleanup() {@@ -475,7 +474,7 @@ async function getPage(const head = document.createElement("head");const title = document.createElement("title");- title.innerHTML = document.title;+ title.innerText = document.title;head.appendChild(title);return {