From 965bdc6638e434a8b0cd72a9868a914cd75739b6 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sat, 15 May 2021 20:14:14 +0200 Subject: [PATCH] Initial commit --- README.md | 8 ++++++++ no-analytics.patch | 13 +++++++++++++ no-drm.patch | 29 +++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 README.md create mode 100644 no-analytics.patch create mode 100644 no-drm.patch diff --git a/README.md b/README.md new file mode 100644 index 0000000..b2d4f28 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# Memex anti-antifeatures + +These are some patches that remove anti-features from the [WorldBrain Memex](https://github.com/WorldBrain/Memex) browser extension. + +- `no-analytics.patch`: Disables analytics/tracking by default. +- `no-drm.patch`: Disables DRM / "Upgrade to Pro" paywall by default. + +Note that these are just patches to remove antifeatures for offline usage; they won't magically get you any kind of hosted service. But there's really no valid reason for local backups to be put behind a "wouldn't want something to happen to your data, would you now?"-type paywall. diff --git a/no-analytics.patch b/no-analytics.patch new file mode 100644 index 0000000..3e09773 --- /dev/null +++ b/no-analytics.patch @@ -0,0 +1,13 @@ +diff --git a/src/analytics/analytics.ts b/src/analytics/analytics.ts +index 9eacc4468..5fa3e197c 100644 +--- a/src/analytics/analytics.ts ++++ b/src/analytics/analytics.ts +@@ -8,7 +8,7 @@ import { + } from './types' + import { ANALYTICS_EVENTS } from './constants' + +-const TRACK_BY_DEFAULT = true ++const TRACK_BY_DEFAULT = false + + export default class AnalyticsManager implements Analytics { + constructor( diff --git a/no-drm.patch b/no-drm.patch new file mode 100644 index 0000000..4c18e9d --- /dev/null +++ b/no-drm.patch @@ -0,0 +1,29 @@ +diff --git a/src/authentication/components/AuthContextProvider.tsx b/src/authentication/components/AuthContextProvider.tsx +index 4709db7f1..1e4f320d3 100644 +--- a/src/authentication/components/AuthContextProvider.tsx ++++ b/src/authentication/components/AuthContextProvider.tsx +@@ -32,6 +32,24 @@ export class AuthContextProvider extends React.Component< + currentUser: user, + }) + ++ user = (user != null) ? user : {}; ++ user.claims = { ++ subscriptionStatus: "active", ++ subscriptionExpiry: 2410006826, ++ subscriptions: { ++ "pro-monthly": { ++ expiry: 2410006826, ++ status: "active" ++ } ++ }, ++ features: { ++ backup: { expiry: 2410006826 }, ++ sync: { expiry: 2410006826 }, ++ beta: { expiry: 2410006826 }, ++ }, ++ lastSubscribed: null ++ }; ++ + if (user !== null && user.claims !== null) { + this.setState({ + currentUser: {