Skip to content

Commit

Permalink
Revert "Add Blt sizzle time tracking and in-progress indicator"
Browse files Browse the repository at this point in the history
  • Loading branch information
DonnieBLT authored Nov 27, 2024
1 parent 6302851 commit e68b28e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 156 deletions.
107 changes: 12 additions & 95 deletions content.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ x.prototype.isEqual = function(a) {

function Rect(a, b) {
this.x = this.c = this.y = this.a = 0;
a && ("undefined" !== typeof a.G && "undefined" !== typeof a.I && "undefined" !== typeof a.H && "undefined" !== typeof a.J ? (this.x = Math.min(a.G, a.H), this.c = Math.abs(a.H - a.G), this.y = Math.min(a.I, a.J), this.a = Math.abs(a.J - a.I)) : "undefined" !== typeof a.x && "undefined" !== typeof a.y && "undefined" !== typeof a.c && "undefined" !== typeof a.a ? (this.x = a.x, this.c = a.c, this.y = a.y, this.a = a.a) : "undefined" !== typeof a.left && "undefined" !== typeof a.top && "undefined" !==
typeof a.right && "undefined" !== typeof a.bottom ? (this.x = a.left, this.c = a.right - a.left, this.y = a.top, this.a = a.top - a.bottom) : "undefined" !== typeof a.x && "undefined" !== typeof a.y && "undefined" !== typeof b.c && "undefined" !== typeof b.a && (this.x = a.x, this.c = b.c, this.y = a.y, this.a = b.a))
a && ("undefined" !== typeof a.G && "undefined" !== typeof a.I && "undefined" !== typeof a.H && "undefined" !== typeof a.J ? (this.x = Math.min(a.G, a.H), this.c = Math.abs(a.H - a.G), this.y = Math.min(a.I, a.J), this.a = Math.abs(a.J - a.I)) : "undefined" !== typeof a.x && "undefined" !== typeof a.y && "undefined" !== typeof a.c && "undefined" !== typeof a.a ? (this.x = a.x, this.c = a.c, this.y = a.y, this.a = a.a) : "undefined" !== typeof a.left && "undefined" !== typeof a.top && "undefined" !== typeof a.right && "undefined" !==
typeof a.bottom ? (this.x = a.left, this.c = a.right - a.left, this.y = a.top, this.a = a.top - a.bottom) : "undefined" !== typeof a.x && "undefined" !== typeof a.y && "undefined" !== typeof b.c && "undefined" !== typeof b.a && (this.x = a.x, this.c = b.c, this.y = a.y, this.a = b.a))
}

function ba(a, b, c) {
Expand Down Expand Up @@ -1771,15 +1771,16 @@ var Z = function() {
B();
return !1
});
b(g +
"+p", function() {
b(g + "+p", function() {
l();
return !1
});
b(g + "+z", function() {
M();
return !1
});
b(g +
"+z",
function() {
M();
return !1
});
a(g + "+a", function() {
s.Wa();
return !1
Expand Down Expand Up @@ -2026,90 +2027,6 @@ var Z = function() {
}
}
}();

// Add code to interface with Blt sizzle time tracking
function startBltSizzleTimer(issueId) {
// Make an API call to start the timer for the given issue
fetch(`https://blt-sizzle-api.example.com/start-timer?issueId=${issueId}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
}
}).then(response => {
if (response.ok) {
console.log('Timer started for issue:', issueId);
} else {
console.error('Failed to start timer for issue:', issueId);
}
}).catch(error => {
console.error('Error starting timer for issue:', issueId, error);
});
}

function stopBltSizzleTimer(issueId) {
// Make an API call to stop the timer for the given issue
fetch(`https://blt-sizzle-api.example.com/stop-timer?issueId=${issueId}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
}
}).then(response => {
if (response.ok) {
console.log('Timer stopped for issue:', issueId);
} else {
console.error('Failed to stop timer for issue:', issueId);
}
}).catch(error => {
console.error('Error stopping timer for issue:', issueId, error);
});
}

// Implement an in-progress indicator on the top right of github.com
function showInProgressIndicator() {
const indicator = document.createElement('div');
indicator.id = 'blt-sizzle-indicator';
indicator.style.position = 'fixed';
indicator.style.top = '10px';
indicator.style.right = '10px';
indicator.style.backgroundColor = 'red';
indicator.style.color = 'white';
indicator.style.padding = '5px';
indicator.style.zIndex = '9999';
indicator.innerText = 'In Progress';
document.body.appendChild(indicator);
}

function hideInProgressIndicator() {
const indicator = document.getElementById('blt-sizzle-indicator');
if (indicator) {
document.body.removeChild(indicator);
}
}

// Add functionality to Quickstart on any issue and have the timer stop and start based on the current issue in the browser
function quickstartIssue(issueId) {
startBltSizzleTimer(issueId);
showInProgressIndicator();
}

function stopIssue(issueId) {
stopBltSizzleTimer(issueId);
hideInProgressIndicator();
}

// Listen for changes in the URL to detect when the user navigates to a different issue
let currentIssueId = null;
setInterval(() => {
const issueIdMatch = window.location.pathname.match(/\/issues\/(\d+)/);
const issueId = issueIdMatch ? issueIdMatch[1] : null;

if (issueId !== currentIssueId) {
if (currentIssueId) {
stopIssue(currentIssueId);
}
if (issueId) {
quickstartIssue(issueId);
}
currentIssueId = issueId;
}
}, 1000);
jQuery(function() {
Ja.ca()
});
53 changes: 0 additions & 53 deletions event.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,56 +567,3 @@ var Q = function(a) {
}();
z.U();

// Add code to handle Blt sizzle time tracking events
function startBltSizzleTimer(issueId) {
// Make an API call to start the timer for the given issue
fetch(`https://blt-sizzle-api.example.com/start-timer?issueId=${issueId}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
}
}).then(response => {
if (response.ok) {
console.log('Timer started for issue:', issueId);
} else {
console.error('Failed to start timer for issue:', issueId);
}
}).catch(error => {
console.error('Error starting timer for issue:', issueId, error);
});
}

function stopBltSizzleTimer(issueId) {
// Make an API call to stop the timer for the given issue
fetch(`https://blt-sizzle-api.example.com/stop-timer?issueId=${issueId}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
}
}).then(response => {
if (response.ok) {
console.log('Timer stopped for issue:', issueId);
} else {
console.error('Failed to stop timer for issue:', issueId);
}
}).catch(error => {
console.error('Error stopping timer for issue:', issueId, error);
});
}

// Implement event listeners for starting and stopping the timer based on the current issue in the browser
let currentIssueId = null;
setInterval(() => {
const issueIdMatch = window.location.pathname.match(/\/issues\/(\d+)/);
const issueId = issueIdMatch ? issueIdMatch[1] : null;

if (issueId !== currentIssueId) {
if (currentIssueId) {
stopBltSizzleTimer(currentIssueId);
}
if (issueId) {
startBltSizzleTimer(issueId);
}
currentIssueId = issueId;
}
}, 1000);
10 changes: 2 additions & 8 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,7 @@
"manifest_version": 2,
"name": "OWASP BLT-Extension",
"short_name": "BLT-Extension",
"permissions": [ "\u003Call_urls>", "activeTab", "storage", "unlimitedStorage", "notifications", "clipboardWrite", "downloads", "tabCapture", "https://blt-sizzle-api.example.com/*" ],
"permissions": [ "\u003Call_urls>", "activeTab", "storage", "unlimitedStorage", "notifications", "clipboardWrite", "downloads", "tabCapture" ],
"update_url": "https://clients2.google.com/service/update2/crx",
"version": "1.4",
"content_scripts": [
{
"matches": ["https://github.com/*"],
"js": ["content.js"]
}
]
"version": "1.4"
}

0 comments on commit e68b28e

Please sign in to comment.