mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 04:00:59 +01:00
clipper(web): make ready for publishing
This commit is contained in:
@@ -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"],
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
"allowJs": true,
|
||||
"jsx": "react-jsx",
|
||||
"maxNodeModuleJsDepth": 5,
|
||||
"declaration": false,
|
||||
"noEmit": true
|
||||
"declaration": false
|
||||
},
|
||||
"include": ["src", "global.d.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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user