mirror of
				https://github.com/notion-enhancer/notion-enhancer.git
				synced 2025-10-31 14:18:08 +11:00 
			
		
		
		
	chore: disable telemetry, remove sponsor perks (temp)
This commit is contained in:
		
							parent
							
								
									c8613d0937
								
							
						
					
					
						commit
						9b36ca26b2
					
				| @ -4,8 +4,10 @@ | |||||||
|  * (https://notion-enhancer.github.io/) under the MIT license
 |  * (https://notion-enhancer.github.io/) under the MIT license
 | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
|  | // telemetry endpoint not ready, disabled for current release
 | ||||||
|  | 
 | ||||||
| import { checkForUpdate } from "./updateCheck.mjs"; | import { checkForUpdate } from "./updateCheck.mjs"; | ||||||
| import { sendTelemetryPing } from "./sendTelemetry.mjs"; | // import { sendTelemetryPing } from "./sendTelemetry.mjs";
 | ||||||
| import { Modal, Frame } from "./islands/Modal.mjs"; | import { Modal, Frame } from "./islands/Modal.mjs"; | ||||||
| import { MenuButton } from "./islands/MenuButton.mjs"; | import { MenuButton } from "./islands/MenuButton.mjs"; | ||||||
| import { Tooltip } from "./islands/Tooltip.mjs"; | import { Tooltip } from "./islands/Tooltip.mjs"; | ||||||
| @ -152,5 +154,5 @@ export default async (api, db) => | |||||||
|     insertPanel(api, db), |     insertPanel(api, db), | ||||||
|     insertCustomStyles(api, db), |     insertCustomStyles(api, db), | ||||||
|     loadThemeOverrides(api, db), |     loadThemeOverrides(api, db), | ||||||
|     sendTelemetryPing(), |     // sendTelemetryPing(),
 | ||||||
|   ]).then(() => api.sendMessage("notion-enhancer", "load-complete")); |   ]).then(() => api.sendMessage("notion-enhancer", "load-complete")); | ||||||
|  | |||||||
| @ -166,14 +166,13 @@ function Banner({ updateAvailable, isDevelopmentBuild }) { | |||||||
|           >Sponsor me |           >Sponsor me | ||||||
|         <//>
 |         <//>
 | ||||||
|       </div> |       </div> | ||||||
|       <!-- Disclaimer: these perks are only a draft, for anyone reading this. |       <!-- Disclaimer: draft of potential perks, to be confirmed before full release. --> | ||||||
|       This information may change at any time. --> |  | ||||||
|       <${Description} class="mt-[6px]"> |       <${Description} class="mt-[6px]"> | ||||||
|         Sponsors help make open-source development sustainable and receive |         <!-- Sponsors help make open-source development sustainable and receive | ||||||
|         access to priority support channels, private developer previews, and |         access to priority support channels, private developer previews, and | ||||||
|         role cosmetics on Discord. A one-time donation is equivalent to 1 month |         role cosmetics on Discord. A one-time donation is equivalent to 1 month | ||||||
|         of sponsor perks. To learn more about perks, read the |         of sponsor perks. To learn more about perks, read the | ||||||
|         <a href=${tsAndCs} class="ml-[3px]">Terms & Conditions</a>. |         <a href=${tsAndCs} class="ml-[3px]">Terms & Conditions</a>. --> | ||||||
|       <//>
 |       <//>
 | ||||||
|     </div>`; |     </div>`; | ||||||
|   initDatabase() |   initDatabase() | ||||||
|  | |||||||
| @ -31,9 +31,7 @@ function Onboarding() { | |||||||
|         process and/or store data on your device (including workspace content, |         process and/or store data on your device (including workspace content, | ||||||
|         device metadata, and notion-enhancer configuration) as described in its |         device metadata, and notion-enhancer configuration) as described in its | ||||||
|         privacy policy. Unless otherwise stated, the notion-enhancer will never |         privacy policy. Unless otherwise stated, the notion-enhancer will never | ||||||
|         transmit your information from your device. Collection of anonymous |         transmit personally identifiable information from your device. | ||||||
|         telemetry data is enabled by default and can be disabled at any time |  | ||||||
|         through the menu. |  | ||||||
|         <br /><br /> |         <br /><br /> | ||||||
|         The notion-enhancer is free and open-source software distributed under |         The notion-enhancer is free and open-source software distributed under | ||||||
|         the <a href="${tsAndCs}#license">MIT License</a> without warranty of any |         the <a href="${tsAndCs}#license">MIT License</a> without warranty of any | ||||||
|  | |||||||
| @ -4,6 +4,8 @@ | |||||||
|  * (https://notion-enhancer.github.io/) under the MIT license
 |  * (https://notion-enhancer.github.io/) under the MIT license
 | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
|  | // telemetry endpoint not ready, disabled for current release
 | ||||||
|  | 
 | ||||||
| import { collectTelemetryData } from "../../sendTelemetry.mjs"; | import { collectTelemetryData } from "../../sendTelemetry.mjs"; | ||||||
| import { Option } from "./Options.mjs"; | import { Option } from "./Options.mjs"; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -9,7 +9,6 @@ import { Sidebar } from "./islands/Sidebar.mjs"; | |||||||
| import { Footer } from "./islands/Footer.mjs"; | import { Footer } from "./islands/Footer.mjs"; | ||||||
| import { Banner } from "./islands/Banner.mjs"; | import { Banner } from "./islands/Banner.mjs"; | ||||||
| import { Onboarding } from "./islands/Onboarding.mjs"; | import { Onboarding } from "./islands/Onboarding.mjs"; | ||||||
| import { Telemetry } from "./islands/Telemetry.mjs"; |  | ||||||
| import { View } from "./islands/View.mjs"; | import { View } from "./islands/View.mjs"; | ||||||
| import { List } from "./islands/List.mjs"; | import { List } from "./islands/List.mjs"; | ||||||
| import { Mod } from "./islands/Mod.mjs"; | import { Mod } from "./islands/Mod.mjs"; | ||||||
| @ -140,7 +139,6 @@ const renderMenu = async () => { | |||||||
|               <//>
 |               <//>
 | ||||||
|               <${View} id="core"> |               <${View} id="core"> | ||||||
|                 <${Options} mod=${mods.find(({ _src }) => _src === "core")} /> |                 <${Options} mod=${mods.find(({ _src }) => _src === "core")} /> | ||||||
|                 <${Telemetry} /> |  | ||||||
|                 <${Profiles} /> |                 <${Profiles} /> | ||||||
|                 <//>
 |                 <//>
 | ||||||
|                 ${[...categories, ...mods] |                 ${[...categories, ...mods] | ||||||
|  | |||||||
| @ -4,6 +4,8 @@ | |||||||
|  * (https://notion-enhancer.github.io/) under the MIT license
 |  * (https://notion-enhancer.github.io/) under the MIT license
 | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
|  | // telemetry endpoint not ready, disabled for current release
 | ||||||
|  | 
 | ||||||
| const pingEndpoint = "https://notion-enhancer.deno.dev/api/ping", | const pingEndpoint = "https://notion-enhancer.deno.dev/api/ping", | ||||||
|   collectTelemetryData = async () => { |   collectTelemetryData = async () => { | ||||||
|     const { platform, version } = globalThis.__enhancerApi, |     const { platform, version } = globalThis.__enhancerApi, | ||||||
| @ -17,29 +19,29 @@ const pingEndpoint = "https://notion-enhancer.deno.dev/api/ping", | |||||||
|     return { platform, version, timezone, enabled_mods }; |     return { platform, version, timezone, enabled_mods }; | ||||||
|   }, |   }, | ||||||
|   sendTelemetryPing = async () => { |   sendTelemetryPing = async () => { | ||||||
|     const db = __enhancerApi.initDatabase(), |     // const db = __enhancerApi.initDatabase(),
 | ||||||
|       { version } = globalThis.__enhancerApi, |     //   { version } = globalThis.__enhancerApi,
 | ||||||
|       agreedToTerms = await db.get("agreedToTerms"), |     //   agreedToTerms = await db.get("agreedToTerms"),
 | ||||||
|       telemetryEnabled = (await db.get("telemetryEnabled")) ?? true; |     //   telemetryEnabled = (await db.get("telemetryEnabled")) ?? true;
 | ||||||
|     if (!telemetryEnabled || agreedToTerms !== version) return; |     // if (!telemetryEnabled || agreedToTerms !== version) return;
 | ||||||
| 
 | 
 | ||||||
|     const lastTelemetryPing = await db.get("lastTelemetryPing"); |     // const lastTelemetryPing = await db.get("lastTelemetryPing");
 | ||||||
|     if (lastTelemetryPing) { |     // if (lastTelemetryPing) {
 | ||||||
|       const msSincePing = Date.now() - new Date(lastTelemetryPing); |     //   const msSincePing = Date.now() - new Date(lastTelemetryPing);
 | ||||||
|       // send ping only once a week
 |     //   // send ping only once a week
 | ||||||
|       if (msSincePing / 8.64e7 < 7) return; |     //   if (msSincePing / 8.64e7 < 7) return;
 | ||||||
|     } |     // }
 | ||||||
| 
 | 
 | ||||||
|     try { |     // try {
 | ||||||
|       const telemetryData = await collectTelemetryData(), |     //   const telemetryData = await collectTelemetryData(),
 | ||||||
|         pingTimestamp = await fetch(pingEndpoint, { |     //     pingTimestamp = await fetch(pingEndpoint, {
 | ||||||
|           method: "POST", |     //       method: "POST",
 | ||||||
|           body: JSON.stringify(telemetryData), |     //       body: JSON.stringify(telemetryData),
 | ||||||
|         }).then((res) => res.text()); |     //     }).then((res) => res.text());
 | ||||||
|       await db.set("lastTelemetryPing", pingTimestamp); |     //   await db.set("lastTelemetryPing", pingTimestamp);
 | ||||||
|     } catch (err) { |     // } catch (err) {
 | ||||||
|       console.error(err); |     //   console.error(err);
 | ||||||
|     } |     // }
 | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
| export { collectTelemetryData, sendTelemetryPing }; | export { collectTelemetryData, sendTelemetryPing }; | ||||||
|  | |||||||
| @ -20,7 +20,6 @@ | |||||||
|     "tabs", |     "tabs", | ||||||
|     "storage", |     "storage", | ||||||
|     "userScripts", |     "userScripts", | ||||||
|     "clipboardRead", |  | ||||||
|     "clipboardWrite", |     "clipboardWrite", | ||||||
|     "unlimitedStorage" |     "unlimitedStorage" | ||||||
|   ], |   ], | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user