Skip to content

Commit

Permalink
Merge pull request #396 from astralevolution/main
Browse files Browse the repository at this point in the history
option to disable ab cloaking in settings
  • Loading branch information
xbubbo authored Jan 24, 2024
2 parents 48be24c + 3783456 commit ba9105f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 17 deletions.
34 changes: 19 additions & 15 deletions static/assets/scripts/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,27 @@ try {
} catch (e) {
inFrame = true
}

var ab = localStorage.getItem('ab')
if (!inFrame && !navigator.userAgent.includes('Firefox')) {
const popup = open('about:blank', '_blank')
if (!popup || popup.closed) alert('Please allow popups and redirects.')
else {
popup.document.write(`
<iframe src="${
location.href
}" style="position:fixed;top:0;left:0;width:100%;height:100%;outline:none;border:none;"></iframe>
<title>${localStorage.getItem('name') || 'My Drive - Google Drive'}</title>
<link rel="icon" href="${
localStorage.getItem('icon') ||
'https://ssl.gstatic.com/assets/media/branding/product/1x/drive_2020q4_32dp.png'
}">
`)
if (ab == 'true' || ab == undefined) {
const popup = open('about:blank', '_blank')
if (!popup || popup.closed) {
alert('Please allow popups and redirects.');
}
else {
popup.document.write(`
<iframe src="${
location.href
}" style="position:fixed;top:0;left:0;width:100%;height:100%;outline:none;border:none;"></iframe>
<title>${localStorage.getItem('name') || 'My Drive - Google Drive'}</title>
<link rel="icon" href="${
localStorage.getItem('icon') ||
'https://ssl.gstatic.com/assets/media/branding/product/1x/drive_2020q4_32dp.png'
}">
`)

location.replace(localStorage.getItem('panicLink') || 'https://classroom.google.com')
location.replace(localStorage.getItem('panicLink') || 'https://classroom.google.com')
}
}
}

Expand Down
12 changes: 12 additions & 0 deletions static/assets/scripts/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,16 @@ function AB() {
location.replace('https://classroom.google.com')
}
}
}
function toggleAB() {
ab = localStorage.getItem('ab')
if (ab == null) {
localStorage.setItem('ab', 'false')
}
else if (ab == 'true') {
localStorage.setItem('ab', 'false')
}
else {
localStorage.setItem('ab', 'true')
}
}
7 changes: 5 additions & 2 deletions static/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@
<div class="settings-container">
<div class="settings-card">
<h3>About:Blank</h3>
<p>Cloak the site in an about:blank page.</p>
<button onclick="AB()">Open Popup</button>
<p>Cloak the site in an about:blank page and toggle about:blank on startup (enabled by default)</p>
<button onclick="AB()" class="key-button">Open Popup</button>
<button class="key-button" onclick="toggleAB()">Toggle automatic about:blank</button>


</div>
<div class="settings-card">
<h3>Set Panic Key</h3>
Expand Down

19 comments on commit ba9105f

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on ba9105f Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
instell ❌ Failed View Logs 2024-01-24T13:36:44.845Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on ba9105f Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
st3llar ❌ Failed View Logs 2024-01-24T13:36:59.580Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on ba9105f Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2024-01-24T13:37:15.891Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on ba9105f Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2024-01-24T13:37:36.508Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on ba9105f Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
we-love-art ✅ Deployed View Logs 2024-01-24T13:37:40.827Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on ba9105f Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2024-01-24T13:37:43.775Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on ba9105f Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
st3lla ❌ Failed View Logs 2024-01-24T13:37:43.795Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on ba9105f Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2024-01-24T13:37:58.123Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on ba9105f Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2024-01-24T13:37:59.241Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on ba9105f Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2024-01-24T13:38:11.108Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on ba9105f Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2024-01-24T13:38:16.128Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on ba9105f Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
mountpath ✅ Deployed View Logs 2024-01-24T13:38:16.640Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on ba9105f Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2024-01-24T13:38:22.051Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on ba9105f Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
classes ✅ Deployed View Logs 2024-01-24T13:38:22.650Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on ba9105f Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ✅ Deployed View Logs 2024-01-24T13:38:26.837Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on ba9105f Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
interstellar ❌ Failed View Logs 2024-01-24T13:38:27.189Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on ba9105f Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
talonnexus ✅ Deployed View Logs 2024-01-24T13:38:29.438Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on ba9105f Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
learnmath ✅ Deployed View Logs 2024-01-24T13:38:44.723Z

@hop-deploy
Copy link

@hop-deploy hop-deploy bot commented on ba9105f Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployment Status Build Logs Updated At
gokudoespartyparty ✅ Deployed View Logs 2024-01-24T13:38:56.085Z

Please sign in to comment.