Skip to content

Commit

Permalink
[extension] add skipContentWarnings option
Browse files Browse the repository at this point in the history
  • Loading branch information
zerodytrash committed Jun 22, 2022
1 parent 0a02240 commit 6b5057e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export let ENABLE_UNLOCK_CONFIRMATION_EMBED = true;
export let ENABLE_UNLOCK_NOTIFICATION = true;

// Disable content warnings?
export let SKIP_CONTENT_WARNINGS = false;
export let SKIP_CONTENT_WARNINGS = true;

// Some Innertube bypass methods require the following authentication headers of the currently logged in user.
export const GOOGLE_AUTH_HEADER_NAMES = ['Authorization', 'X-Goog-AuthUser'];
Expand Down Expand Up @@ -45,6 +45,9 @@ if (window.SYARB_CONFIG) {
case 'unlockConfirmation':
ENABLE_UNLOCK_CONFIRMATION_EMBED = options[option];
break;
case 'skipContentWarnings':
SKIP_CONTENT_WARNINGS = options[option];
break;
}
}
}
Expand Down
13 changes: 13 additions & 0 deletions src/extension/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,16 @@ <h1 id="title">Age Restriction Bypass for YouTube™</h1>
</button>
<span>Settings</span>
</div>
<label class="menu-item button">
<div class="icon">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 512 512" width="24px" fill="#000000"><path d="M506.3 417l-213.3-364c-16.33-28-57.54-28-73.98 0l-213.2 364C-10.59 444.9 9.849 480 42.74 480h426.6C502.1 480 522.6 445 506.3 417zM232 168c0-13.25 10.75-24 24-24S280 154.8 280 168v128c0 13.25-10.75 24-23.1 24S232 309.3 232 296V168zM256 416c-17.36 0-31.44-14.08-31.44-31.44c0-17.36 14.07-31.44 31.44-31.44s31.44 14.08 31.44 31.44C287.4 401.9 273.4 416 256 416z"/></svg>
</div>
<span>Skip Content Warnings</span>
<label class="switch">
<input type="checkbox" name="skipContentWarnings">
<span class="slider"></span>
</label>
</label>
<label class="menu-item button">
<div class="icon">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-1.29 1.29c-.63.63-.19 1.71.7 1.71h13.17c.89 0 1.34-1.08.71-1.71L18 16z"/></svg>
Expand All @@ -196,6 +206,9 @@ <h1 id="title">Age Restriction Bypass for YouTube™</h1>
</label>
</label>
<label class="menu-item button">
<div class="icon">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 448 512" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M438.6 105.4C451.1 117.9 451.1 138.1 438.6 150.6L182.6 406.6C170.1 419.1 149.9 419.1 137.4 406.6L9.372 278.6C-3.124 266.1-3.124 245.9 9.372 233.4C21.87 220.9 42.13 220.9 54.63 233.4L159.1 338.7L393.4 105.4C405.9 92.88 426.1 92.88 438.6 105.4H438.6z"/></svg>
</div>
<span>Unlock Confirmation (embed)</span>
<label class="switch">
<input type="checkbox" name="unlockConfirmation">
Expand Down
1 change: 1 addition & 0 deletions src/extension/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function initSettings() {
const nReset = nSettings.querySelector('#reset');

const defaultOptions = {
skipContentWarnings: true,
unlockNotification: true,
unlockConfirmation: true,
};
Expand Down

0 comments on commit 6b5057e

Please sign in to comment.