Skip to content

Commit

Permalink
Remove tracking, notifications & permissions
Browse files Browse the repository at this point in the history
Attempt to remove analytics tracking & externally-delivered notification popups. Also removed some permissions to match older v7.1.6 by deanoemcke (original developer)

Untested and without guarantee!
  • Loading branch information
aciidic committed Dec 16, 2020
1 parent 108c237 commit 2b6225c
Show file tree
Hide file tree
Showing 23 changed files with 54 additions and 170 deletions.
33 changes: 22 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
# The Great Suspender
# The Great Suspender - Without Analytics Tracking

Modified version of "The Great Suspender" to remove analytics tracking and rogue .js files from anonymous developer who is now in control of the GitHub source & web store versions. [Read More]()

Read more:
[New ownership announcement](https://github.com/aciidic/thegreatsuspender/issues/1175)
[New maintainer is probably malicious](https://github.com/aciidic/thegreatsuspender/issues/1263)
[Flagged as malware by Microsoft Edge](https://www.windowscentral.com/great-suspender-extension-now-flagged-malware-edge-has-built-replacement)
[Reddit forum discussion](https://old.reddit.com/r/HobbyDrama/comments/jouwq7/open_source_development_the_great_suspender_saga/)
[Medium Article](https://medium.com/nerd-for-tech/malware-in-browser-extensions-3805e8763dd5)

This project is a fork from [v7.1.8 of The Great Suspender](https://github.com/greatsuspender/thegreatsuspender) with all tracking code removed, along with some annoying popups/prompts.

This work carries no guarantees only to the best of my ability in 2 hours using notepad2 & AstroGrep. I am not a developer and do not intend to spend much time keeping this extension updated.

<img src="/src/img/suspendy-guy.png" width="100px" />

"The Great Suspender" is a free and open-source Google Chrome extension for people who find that chrome is consuming too much system resource or suffer from frequent chrome crashing. Once installed and enabled, this extension will automatically *suspend* tabs that have not been used for a while, freeing up memory and cpu that the tab was consuming.

If you have suggestions or problems using the extension, please [submit a bug or a feature request](https://github.com/greatsuspender/thegreatsuspender/issues/). For other enquiries you can email me at greatsuspender@gmail.com.
If you have suggestions or problems using the extension, please [submit a pull request](https://github.com/aciidic/thegreatsuspender/issues/).

**If you have lost tabs from your browser:** I have written a guide for how to recover your lost tabs [here](https://github.com/deanoemcke/thegreatsuspender/issues/526
**If you have lost tabs from your browser:** The original developer has written a guide for how to recover your lost tabs [here](https://github.com/deanoemcke/thegreatsuspender/issues/526
).

### Chrome Web Store

The Great Suspender is [available via the official Chrome Web Store](https://chrome.google.com/webstore/detail/the-great-suspender/klbibkeccnjlkjkiokjodocebajanakg).

Please note that the webstore version may be behind the latest version here. That is because I try to keep webstore updates down to a minimum due to their [disruptive effect](https://github.com/greatsuspender/thegreatsuspender/issues/526).
This version of The Great Suspender is not available on the Chrome Web Store.

For more information on the permissions required for the extension, please refer to this gitHub issue: (https://github.com/greatsuspender/thegreatsuspender/issues/213)

### Install as an extension from source
### You should install this extension from source

1. Download the **[latest available version](https://github.com/greatsuspender/thegreatsuspender/releases)** and unarchive to your preferred location (whichever suits you).
1. Download the **[latest available version](https://github.com/aciidic/thegreatsuspender/releases)** and unarchive to your preferred location (whichever suits you).
2. Using **Google Chrome** browser, navigate to chrome://extensions/ and enable "Developer mode" in the upper right corner.
3. Click on the <kbd>Load unpacked extension...</kbd> button.
4. Browse to the src directory of the unarchived folder and confirm.
Expand All @@ -28,7 +38,7 @@ If you have completed the above steps, the "welcome" page will open indicating s

Be sure to unsuspend all suspended tabs before removing any other version of the extension or they will disappear forever!

### Build from github
### Build from github (untested in this release)

Dependencies: openssl, npm.

Expand All @@ -48,7 +58,7 @@ The extension in crx format will be inside the build/crx/ directory. You can dra

### Integrating with another Chrome extension or app

This extension has a small external api to allow other extensions to request the suspension of a tab. See [this issue](https://github.com/greatsuspender/thegreatsuspender/issues/276) for more information. And please let me know about it so that I can try it out!
The extension has a small external api to allow other extensions to request the suspension of a tab. See [this issue](https://github.com/greatsuspender/thegreatsuspender/issues/276) for more information. And please let me know about it so that I can try it out!

### Windows Group Policies

Expand Down Expand Up @@ -93,3 +103,4 @@ This work is licensed under a GNU GENERAL PUBLIC LICENSE (v2)
This package uses the [html2canvas](https://github.com/niklasvh/html2canvas) library written by Niklas von Hertzen.
It also uses the indexedDb wrapper [db.js](https://github.com/aaronpowell/db.js) written by Aaron Powell.
Thank you also to [BrowserStack](https://www.browserstack.com) for providing free chrome testing tools.
Original source from [The Great Suspender v7.1.8](https://github.com/greatsuspender/thegreatsuspender)
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "thegreatsuspender",
"name": "thegreatsuspender-notrack",
"version": "0.0.0",
"description": "A chrome extension for suspending all tabs to free up memory",
"description": "A chrome extension for suspending all tabs to free up memory. Without analytics tracking.",
"main": "",
"scripts": {
"build": "grunt",
Expand All @@ -11,20 +11,23 @@
},
"repository": {
"type": "git",
"url": "git://github.com/greatsuspender/thegreatsuspender.git"
"url": "git://github.com/aciidic/thegreatsuspender.git"
},
"keywords": [
"chrome",
"extension",
"addon",
"memory",
"suspend",
"tab"
"tab",
"private",
"privacy",
"notrack"
],
"author": "deanoemcke",
"author": "aciidic",
"license": "GPLv2",
"bugs": {
"url": "https://github.com/greatsuspender/thegreatsuspender/issues"
"url": "https://github.com/aciidic/thegreatsuspender/issues"
},
"devDependencies": {
"eslint": "^4.19.1",
Expand Down
2 changes: 0 additions & 2 deletions src/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@
"html_options_other_enable_sync_tooltip_line1b": { "message": "logged in with the same profile." },
"html_options_other_enable_sync_tooltip_line2": { "message": "This will also synchronise settings in incognito mode." },
"html_options_other_enable_sync_warning": { "message": "Turning this on will overwrite settings on all other browsers logged into the same Chrome profile" },
"html_options_tracking_opt_out": { "message": "Automatic deactivation of any kind of tracking" },
"html_options_tracking_opt_out_line1": { "message": "This option will disable tracking code, such as that from Google Analytics." },
"html_options_suspend_on_low_memory": { "message": "Instantly suspend when system memory gets very low" },
"html_options_suspend_on_low_memory_tooltip_line1": { "message": "This option will override Chrome's automatic tab discarding functionality." },
"html_options_suspend_on_low_memory_tooltip_line2": { "message": "If enabled, it will force a tab to suspend instead of being discarded by Chrome." },
Expand Down
9 changes: 4 additions & 5 deletions src/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,14 @@ <h1 data-i18n="__MSG_ext_extension_name__"></h1>

<p>
<span data-i18n="__MSG_html_about_github_title__: "></span>
<a href="https://github.com/greatsuspender/thegreatsuspender/issues" target="_blank">github.com/greatsuspender/thegreatsuspender</a>
<br />
<span data-i18n="__MSG_html_about_twitter_title__: "></span>
<a href="https://twitter.com/greatsuspender" target="_blank">@greatsuspender</a>
<a href="https://github.com/aciidic/thegreatsuspender/issues" target="_blank">github.com/aciidic/thegreatsuspender</a>
<br />
</p>

<p>
<span data-i18n="__MSG_html_about_report_issues_prefix__ "></span>
<!--keep the span below on the same line and the link (to remove an extra whitespace before the suffix-->
<a href="https://github.com/greatsuspender/thegreatsuspender/issues" target="_blank" data-i18n="__MSG_html_about_the_github_issues_page__"></a><span data-i18n="__MSG_html_about_report_issues_suffix__"></span>
<a href="https://github.com/aciidic/thegreatsuspender/issues" target="_blank" data-i18n="__MSG_html_about_the_github_issues_page__"></a><span data-i18n="__MSG_html_about_report_issues_suffix__"></span>
</p>

<p>
Expand All @@ -71,6 +68,8 @@ <h1 data-i18n="__MSG_ext_extension_name__"></h1>
<span data-i18n="__MSG_html_about_browserstack_prefix__ "></span>
<a href="https://www.browserstack.com" target="_blank" data-i18n="__MSG_html_about_browserstack__"></a>
<span data-i18n="__MSG_html_about_browserstack_suffix__"></span>
<br />
<a href="https://github.com/greatsuspender/thegreatsuspender">Original Project</a>
</p>
</div>

Expand Down
2 changes: 1 addition & 1 deletion src/broken.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div>
<h1>Ruh Roh!</h1>
<p>The Great Suspender failed to start. Perhaps you are using an incompatible version of chrome?</p>
<p>Try to restart the extension. If the problem persists, ask for help on the <a href="https://github.com/greatsuspender/thegreatsuspender/issues">GitHub project page</a>.</p>
<p>Try to restart the extension. If the problem persists, ask for help on the <a href="https://github.com/aciidic/thegreatsuspender/issues">GitHub project page</a>.</p>
<p>You can recover lost tabs from the <a id="sessionManagementLink" href="#">session management page</a>.</p>
<hr />
<button id="restartExtension" class="btn">Restart extension</button>
Expand Down
3 changes: 1 addition & 2 deletions src/js/about.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global chrome, XMLHttpRequest, gsStorage, gsAnalytics, gsUtils */
/* global chrome, XMLHttpRequest, gsStorage, gsUtils */
(function(global) {
'use strict';

Expand All @@ -24,5 +24,4 @@
}
});

gsAnalytics.reportPageView('about.html');
})(this);
93 changes: 2 additions & 91 deletions src/js/background.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* global gsStorage, gsChrome, gsIndexedDb, gsUtils, gsFavicon, gsSession, gsMessages, gsTabSuspendManager, gsTabDiscardManager, gsAnalytics, gsTabCheckManager, gsSuspendedTab, chrome, XMLHttpRequest */
/* global gsStorage, gsChrome, gsIndexedDb, gsUtils, gsFavicon, gsSession, gsMessages, gsTabSuspendManager, gsTabDiscardManager, gsTabCheckManager, gsSuspendedTab, chrome, XMLHttpRequest */
/*
* The Great Suspender
* Copyright (C) 2017 Dean Oemcke
* Available under GNU GENERAL PUBLIC LICENSE v2
* http://github.com/greatsuspender/thegreatsuspender
* http://github.com/aciidic/thegreatsuspender
* ༼ つ ◕_◕ ༽つ
*/
var tgs = (function() {
Expand Down Expand Up @@ -35,7 +35,6 @@ var tgs = (function() {
const focusDelay = 500;
const noticeCheckInterval = 1000 * 60 * 60 * 12; // every 12 hours
const sessionMetricsCheckInterval = 1000 * 60 * 15; // every 15 minutes
const analyticsCheckInterval = 1000 * 60 * 60 * 23.5; // every 23.5 hours

const _tabStateByTabId = {};
const _currentFocusedTabIdByWindowId = {};
Expand All @@ -56,7 +55,6 @@ var tgs = (function() {
tgs,
gsUtils,
gsChrome,
gsAnalytics,
gsStorage,
gsIndexedDb,
gsMessages,
Expand Down Expand Up @@ -142,9 +140,7 @@ var tgs = (function() {
}

function startTimers() {
startNoticeCheckerJob();
startSessionMetricsJob();
startAnalyticsUpdateJob();
}

function getInternalViewByTabId(tabId) {
Expand Down Expand Up @@ -1183,70 +1179,6 @@ var tgs = (function() {
});
}

function checkForNotices() {
gsUtils.log('background', 'Checking for notices..');
var xhr = new XMLHttpRequest();
var lastShownNoticeVersion = gsStorage.fetchNoticeVersion();

xhr.open('GET', 'https://greatsuspender.github.io/notice.json', true);
xhr.timeout = 4000;
xhr.setRequestHeader('Cache-Control', 'no-cache');
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.responseText) {
var resp;
try {
resp = JSON.parse(xhr.responseText);
} catch (e) {
gsUtils.error(
'background',
'Failed to parse notice response',
xhr.responseText
);
return;
}

if (!resp || !resp.active || !resp.text) {
gsUtils.log('background', 'No new notice found');
return;
}

//only show notice if it is intended for this extension version
var noticeTargetExtensionVersion = String(resp.target);
if (
noticeTargetExtensionVersion !== chrome.runtime.getManifest().version
) {
gsUtils.log(
'background',
`Notice target extension version: ${noticeTargetExtensionVersion}
does not match actual extension version: ${
chrome.runtime.getManifest().version
}`
);
return;
}

//only show notice if it has not already been shown
var noticeVersion = String(resp.version);
if (noticeVersion <= lastShownNoticeVersion) {
gsUtils.log(
'background',
`Notice version: ${noticeVersion} is not greater than last shown notice version: ${lastShownNoticeVersion}`
);
return;
}

//show notice - set global notice field (so that it can be trigger to show later)
_noticeToDisplay = resp;
gsAnalytics.reportEvent(
'Notice',
'Prep',
resp.target + ':' + resp.version
);
}
};
xhr.send();
}

function requestNotice() {
return _noticeToDisplay;
}
Expand Down Expand Up @@ -1761,11 +1693,6 @@ var tgs = (function() {
var noticeToDisplay = requestNotice();
if (noticeToDisplay) {
chrome.tabs.create({ url: chrome.extension.getURL('notice.html') });
gsAnalytics.reportEvent(
'Notice',
'Display',
noticeToDisplay.target + ':' + noticeToDisplay.version
);
}
});
chrome.windows.onRemoved.addListener(function(windowId) {
Expand Down Expand Up @@ -1812,11 +1739,6 @@ var tgs = (function() {
});
}

function startNoticeCheckerJob() {
checkForNotices();
window.setInterval(checkForNotices, noticeCheckInterval);
}

function startSessionMetricsJob() {
gsSession.updateSessionMetrics(true);
window.setInterval(
Expand All @@ -1825,14 +1747,6 @@ var tgs = (function() {
);
}

function startAnalyticsUpdateJob() {
window.setInterval(() => {
gsAnalytics.performPingReport();
const reset = true;
gsSession.updateSessionMetrics(reset);
}, analyticsCheckInterval);
}

return {
STATE_TIMER_DETAILS,
STATE_UNLOADED_URL,
Expand Down Expand Up @@ -1890,7 +1804,6 @@ Promise.resolve()
.then(() => {
// initialise other gsLibs
return Promise.all([
gsAnalytics.initAsPromised(),
gsFavicon.initAsPromised(),
gsTabSuspendManager.initAsPromised(),
gsTabCheckManager.initAsPromised(),
Expand All @@ -1911,7 +1824,5 @@ Promise.resolve()
gsUtils.error('background init error: ', error);
})
.finally(() => {
gsAnalytics.performStartupReport();
gsAnalytics.performVersionReport();
tgs.startTimers();
});
3 changes: 1 addition & 2 deletions src/js/broken.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global chrome, gsAnalytics */
/*global chrome */
(function(global) {
'use strict';

Expand All @@ -20,7 +20,6 @@
.addEventListener('click', function() {
chrome.tabs.create({ url: chrome.extension.getURL('history.html') });
});
gsAnalytics.reportPageView('broken.html');
}
if (document.readyState !== 'loading') {
init();
Expand Down
2 changes: 1 addition & 1 deletion src/js/contentscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* The Great Suspender
* Copyright (C) 2017 Dean Oemcke
* Available under GNU GENERAL PUBLIC LICENSE v2
* http://github.com/greatsuspender/thegreatsuspender
* http://github.com/aciidic/thegreatsuspender
* ლ(ಠ益ಠლ)
*/
(function() {
Expand Down
3 changes: 1 addition & 2 deletions src/js/debug.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global chrome, tgs, gsAnalytics, gsUtils, gsFavicon, gsStorage, gsChrome */
/*global chrome, tgs, gsUtils, gsFavicon, gsStorage, gsChrome */
(function(global) {
'use strict';

Expand Down Expand Up @@ -144,5 +144,4 @@
});
*/
});
gsAnalytics.reportPageView('debug.html');
})(this);
5 changes: 1 addition & 4 deletions src/js/gsStorage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global chrome, gsAnalytics, gsSession, localStorage, gsUtils */
/*global chrome, gsSession, localStorage, gsUtils */
'use strict';

// Used to keep track of which settings were defined in the managed storage
Expand Down Expand Up @@ -26,7 +26,6 @@ const gsStorageSettings = {
DISCARD_AFTER_SUSPEND: 'discardAfterSuspend',
DISCARD_IN_PLACE_OF_SUSPEND: 'discardInPlaceOfSuspend',
USE_ALT_SCREEN_CAPTURE_LIB: 'useAlternateScreenCaptureLib',
TRACKING_OPT_OUT: 'trackingOptOut',
ENABLE_CLEAN_SCREENCAPS: 'cleanScreencaps'
};

Expand Down Expand Up @@ -66,7 +65,6 @@ var gsStorage = {
defaults[gsStorage.NO_NAG] = false;
defaults[gsStorage.WHITELIST] = '';
defaults[gsStorage.THEME] = 'light';
defaults[gsStorage.TRACKING_OPT_OUT] = false;
defaults[gsStorage.ENABLE_CLEAN_SCREENCAPS] = false;

return defaults;
Expand Down Expand Up @@ -305,7 +303,6 @@ var gsStorage = {
saveSettings: function(settings) {
try {
localStorage.setItem('gsSettings', JSON.stringify(settings));
gsAnalytics.setUserDimensions();
} catch (e) {
gsUtils.error(
'gsStorage',
Expand Down

0 comments on commit 2b6225c

Please sign in to comment.