| const fs = require('fs') | ||
| const path = require('path') | ||
| const outFilePath = path.join(__dirname, '_page-script-js-string.ts') | ||
| const pageScriptPath = path.join(__dirname, 'page-script.js') | ||
| try { | ||
| const pageScriptContent = fs.readFileSync(pageScriptPath, 'utf8') | ||
| const escapedContent = pageScriptContent.replace(/\\/g, '\\') | ||
| const finalContent = `export const PAGE_SCRIPT_JS_STRING = \`<script>\n${escapedContent}</script>\`` | ||
| fs.writeFileSync(outFilePath, finalContent) | ||
| console.log('Page script was built successfully!') | ||
| } catch (error) { | ||
| console.error('Failed to build page script:', error) | ||
| } |
@@ -7,3 +7,3 @@ #!/usr/bin/env node | ||
| // package.json | ||
| var version = "1.0.27"; | ||
| var version = "1.0.29"; | ||
@@ -67,3 +67,2 @@ // src/cli/init-repo.ts | ||
| return domain && domain.length > 0 && isValidDomain(domain, { | ||
| subdomain: false, | ||
| wildcard: false | ||
@@ -70,0 +69,0 @@ }); |
+1
-1
| { | ||
| "name": "notehost", | ||
| "version": "1.0.28", | ||
| "version": "1.0.29", | ||
| "description": "NoteHost is a free and powerful Notion hosting service.", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/velsa/notehost", |
@@ -7,3 +7,3 @@ { | ||
| "scripts": { | ||
| "prebuild": "./build-page-script-js-string.sh", | ||
| "prebuild": "node ./src/_build-page-script-js-string.js", | ||
| "start": "npm run prebuild && npx --yes wrangler@latest dev", | ||
@@ -10,0 +10,0 @@ "deploy": "npm run prebuild && npx --yes wrangler@latest deploy", |
@@ -6,3 +6,3 @@ export const PAGE_SCRIPT_JS_STRING = `<script> | ||
| // Description: This script is injected into the Notion page and runs on every page load. | ||
| // This script is injected into the Notion page and runs on every page load. | ||
| window.onload = function () { | ||
@@ -21,4 +21,4 @@ setInterval(() => { | ||
| } | ||
| }) | ||
| }, 1000) | ||
| } | ||
| </script>` | ||
| </script>` |
| #!/bin/bash | ||
| OUT_FILE=./src/_page-script-js-string.ts | ||
| echo 'export const PAGE_SCRIPT_JS_STRING = `<script>' >$OUT_FILE | ||
| cat ./src/page-script.js | sed 's/\\/\\\\/g' >>$OUT_FILE | ||
| echo '</script>`' >>$OUT_FILE |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
168388
0.23%2385
0.46%13
8.33%