Skip to content

Commit

Permalink
Removal of libs, GA
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterPhilip committed Aug 6, 2024
1 parent b6d4d9f commit 2af3680
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 288 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = function (grunt) {
"extension": {
"production": {
"name": "Omnibug",
"version": "2.0.0",
"version": "2.0.1",
"storageKey": "omnibug",
"feedbackUrl": "https://github.com/MisterPhilip/omnibug/issues",
"analyticsID": "UA-114343677-2"
Expand Down
59 changes: 0 additions & 59 deletions src/assets/js/google-analytics.js

This file was deleted.

71 changes: 6 additions & 65 deletions src/libs/OmnibugTracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,69 +2,10 @@
* Omnibug Tracker
*/
// eslint-disable-next-line no-unused-vars
class OmnibugTracker
{
constructor()
{
window.tracker = function(){ (window.tracker.q = window.tracker.q||[]).push(arguments), window.tracker.l=1*new Date(); };
this.loaded = false;
class OmnibugTracker {

// Set defaults
this.track(["create", "##OMNIBUG_UA_ACCOUNT##", "auto"], true);
this.track(["set", "checkProtocolTask", ()=>{}], true);
this.track(["set", "forceSSL", true], true);
this.track(["set", "dimension1", "##OMNIBUG_VERSION##"], true);
}

static get browserTrackingEnabled()
{
return true;
}

/**
* Load GA on the page
*/
init(allowTracking = true)
{
this.updateAllowTracking(allowTracking);

if(!this.loaded) {

// Load GA script
window.GoogleAnalyticsObject = "tracker";
(function(o,m,n,i,b,u,g){o["GoogleAnalyticsObject"]=b;o[b]=o[b]||function(){
(o[b].q=o[b].q||[]).push(arguments);},o[b].l=1*new Date();u=m.createElement(n),
g = m.getElementsByTagName(n)[0]; u.async = 1; u.src = i; g.parentNode.insertBefore(u, g);
})(window,document,"script","../../assets/js/google-analytics.js","tracker");

this.loaded = true;
}
}

/**
* Update settings
*
* @param allowTracking
*/
updateAllowTracking(allowTracking = true)
{
this.allowTracking = allowTracking;
}

/**
* ga() wrapper
*
* @param data
* @param force
*/
track(data, force = false)
{
try {
if(this.allowTracking || force) {
window.tracker.apply(window, data);
}
} catch(e) {
console.error(e.message);
}
}
}
static get browserTrackingEnabled() { return false; }
init(allowTracking = true) { }
updateAllowTracking(allowTracking = true) { }
track(data, force = false) { }
}
3 changes: 1 addition & 2 deletions src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"browser_specific_settings": {
"gecko": {
"id": "[email protected]",
"strict_max_version": "*",
"strict_min_version": "109"
"strict_min_version": "109.0"
}
},
"description": "Omnibug is a browser extension to decode and display outgoing digital marketing tool requests.",
Expand Down
89 changes: 0 additions & 89 deletions src/pages/installed.html

This file was deleted.

72 changes: 0 additions & 72 deletions src/pages/installed.js

This file was deleted.

0 comments on commit 2af3680

Please sign in to comment.