diff --git a/manifest/manifest.json b/manifest/manifest.json index e2a79254..8fa712e4 100644 --- a/manifest/manifest.json +++ b/manifest/manifest.json @@ -1,9 +1,9 @@ { - "name": "__MSG_fullName__", - "short_name": "SponsorBlock", + "name": "SponsorLock - The Solution", + "short_name": "SponsorLlock", "version": "4.2.1", "default_locale": "en", - "description": "__MSG_Description__", + "description": "SponsorLock only shows you promotion, and skips all useful informaton.", "homepage_url": "https://sponsor.ajay.app", "content_scripts": [{ "run_at": "document_start", @@ -73,8 +73,8 @@ ] }, "icons": { - "16": "icons/IconSponsorBlocker16px.png", - "32": "icons/IconSponsorBlocker32px.png", + "16": "icons/LogoSponsorBlocker64px.png", + "32": "icons/LogoSponsorBlocker64px.png", "64": "icons/LogoSponsorBlocker64px.png", "128": "icons/LogoSponsorBlocker128px.png", "256": "icons/LogoSponsorBlocker256px.png", @@ -82,7 +82,7 @@ "1024": "icons/LogoSponsorBlocker1024px.png" }, "options_ui": { - "page": "options/options.html", + "page": "options/lock-options.html", "open_in_tab": true }, "manifest_version": 2 diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index 1d3e9f15..116d0217 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -540,7 +540,7 @@ "description": "Used between segments. Example: 1:20 to 1:30" }, "category_sponsor": { - "message": "Sponsor" + "message": "Useful Content" }, "category_sponsor_description": { "message": "Paid promotion, paid referrals and direct advertisements. Not for self-promotion or free shoutouts to causes/creators/websites/products they like." diff --git a/public/help/index.html b/public/help/index.html index ee886089..bbce1855 100644 --- a/public/help/index.html +++ b/public/help/index.html @@ -4,7 +4,7 @@ SponsorBlock - + @@ -16,97 +16,28 @@
- SponsorBlock + SponsorLock
-

- - Created By Ajay Ramachandran - (Donate) -

-

__MSG_helpPageThanksForInstalling__ By using this extension, you agree to the Privacy Policy and Terms of Use.

- Come contribute, make some suggestions and help out on Discord or on Matrix. + Good luck! This extension was created for April 1st 2022.

__MSG_helpPageReviewOptions__

-

- __MSG_helpPageFeatureDisclaimer__ -

- - - -

__MSG_helpPageHowSkippingWorks__

- -

- - - - - __MSG_helpPageHowSkippingWorks1__ - -
-
- - __MSG_helpPageHowSkippingWorks2__ -

- -
- -

__MSG_Submitting__

- -

- - - __MSG_helpPageSubmitting1__ - -
-
- - __MSG_helpPageSubmitting2__ -

- -

__MSG_Editing__

- -

- - - - - __MSG_helpPageEditing1__ - -

- -

__MSG_helpPageTooSlow__

- -

- __MSG_helpPageTooSlow1__ -

- -

__MSG_helpPageCopyOfDatabase__

- -

- __MSG_helpPageCopyOfDatabase1__ https://sponsor.ajay.app/database. __MSG_helpPageCopyOfDatabase2__ -

- -

__MSG_helpPageNews__

- -

- See https://sponsor.ajay.app/news. -

+

__MSG_helpPageSourceCode__

Client:

- +

Server:

@@ -114,16 +45,6 @@

__MSG_Credits__

-

- Thanks to all SponsorBlock contributors, - SponsorBlockServer contributors and - SponsorBlockSite contributors such - as NDev, Joe Dowd, - Michael Chang and more. -

- -

The awesome Invidious API is used to grab the time the video was published.

-

Some icons made by Gregor Cresnar from www.flaticon.com and are licensed by CC 3.0 BY

Some icons made by Freepik from www.flaticon.com and are licensed by CC 3.0 BY

diff --git a/public/icons/IconSponsorBlocker256px.png b/public/icons/IconSponsorBlocker256px.png index 9870f586..a11035bc 100644 Binary files a/public/icons/IconSponsorBlocker256px.png and b/public/icons/IconSponsorBlocker256px.png differ diff --git a/public/icons/LogoSponsorBlocker1024px.png b/public/icons/LogoSponsorBlocker1024px.png index 2b15e3f8..c8ce9318 100644 Binary files a/public/icons/LogoSponsorBlocker1024px.png and b/public/icons/LogoSponsorBlocker1024px.png differ diff --git a/public/icons/LogoSponsorBlocker128px.png b/public/icons/LogoSponsorBlocker128px.png index 1126f907..0974c2cd 100644 Binary files a/public/icons/LogoSponsorBlocker128px.png and b/public/icons/LogoSponsorBlocker128px.png differ diff --git a/public/icons/LogoSponsorBlocker256px.png b/public/icons/LogoSponsorBlocker256px.png index 71602e23..a11035bc 100644 Binary files a/public/icons/LogoSponsorBlocker256px.png and b/public/icons/LogoSponsorBlocker256px.png differ diff --git a/public/icons/LogoSponsorBlocker512px.png b/public/icons/LogoSponsorBlocker512px.png index 5445bd6a..9392b12e 100644 Binary files a/public/icons/LogoSponsorBlocker512px.png and b/public/icons/LogoSponsorBlocker512px.png differ diff --git a/public/icons/LogoSponsorBlocker64px.png b/public/icons/LogoSponsorBlocker64px.png index 31094742..cae7a568 100644 Binary files a/public/icons/LogoSponsorBlocker64px.png and b/public/icons/LogoSponsorBlocker64px.png differ diff --git a/public/icons/PlayerStartIconSponsorBlocker.svg b/public/icons/PlayerStartIconSponsorBlocker.svg index d31c673a..d1803efc 100644 --- a/public/icons/PlayerStartIconSponsorBlocker.svg +++ b/public/icons/PlayerStartIconSponsorBlocker.svg @@ -1,17 +1,20 @@ + inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)" + inkscape:export-filename="/home/ajay/projects/sb-extension/public/icons/LogoSponsorBlocker1024px.png" + inkscape:export-xdpi="173.9155" + inkscape:export-ydpi="173.9155" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> @@ -33,16 +36,17 @@ inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="1920" - inkscape:window-height="1001" + inkscape:window-height="983" id="namedview18" showgrid="false" inkscape:zoom="0.83098592" - inkscape:cx="-0.3618106" - inkscape:cy="322.44266" - inkscape:window-x="477" - inkscape:window-y="961" + inkscape:cx="444.69697" + inkscape:cy="271.26356" + inkscape:window-x="380" + inkscape:window-y="768" inkscape:window-maximized="1" - inkscape:current-layer="Layer_1-2" /> + inkscape:current-layer="Layer_1-2" + inkscape:pagecheckerboard="0" /> diff --git a/public/options/lock-options.html b/public/options/lock-options.html new file mode 100644 index 00000000..0cb8c528 --- /dev/null +++ b/public/options/lock-options.html @@ -0,0 +1,41 @@ + + + + + __MSG_Options__ - SponsorBlock + + + + + + + + + + + + +
+ + + +
+ +
+
+ With SponsorLock, we decide for you! +
+ + Would you want it any other way? +
+ +
+ + diff --git a/public/options/options.html b/public/options/options.html index 4f2bd730..662dbdce 100644 --- a/public/options/options.html +++ b/public/options/options.html @@ -5,7 +5,7 @@ __MSG_Options__ - SponsorBlock - + diff --git a/public/popup.html b/public/popup.html index 78001e86..ca056eb8 100644 --- a/public/popup.html +++ b/public/popup.html @@ -13,7 +13,7 @@
@@ -147,8 +147,7 @@
Discord | Matrix | - __MSG_help__ | - $ + __MSG_help__ diff --git a/src/background.ts b/src/background.ts index 5a7bacd5..3b0aa097 100644 --- a/src/background.ts +++ b/src/background.ts @@ -32,7 +32,7 @@ chrome.tabs.onUpdated.addListener(function(tabId) { chrome.runtime.onMessage.addListener(function (request, sender, callback) { switch(request.message) { case "openConfig": - chrome.tabs.create({url: chrome.runtime.getURL('options/options.html' + (request.hash ? '#' + request.hash : ''))}); + chrome.tabs.create({url: chrome.runtime.getURL('options/lock-options.html' + (request.hash ? '#' + request.hash : ''))}); return; case "openHelp": chrome.tabs.create({url: chrome.runtime.getURL('help/index.html')}); diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index 6b3246d3..ab43ed09 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -152,12 +152,6 @@ class SkipNoticeComponent extends React.Component this.closeListener()} smaller={this.state.smaller} limitWidth={true} - firstColumn={firstColumn} - bottomRow={[...this.getMessageBoxes(), ...this.getBottomRow() ]} + bottomRow={[...this.getMessageBoxes()]} onMouseEnter={() => this.onMouseEnter() } > ); @@ -388,11 +381,11 @@ class SkipNoticeComponent extends React.Component { } function migrateOldSyncFormats(config: SBConfig) { - if (config["segmentTimes"]) { - const unsubmittedSegments = {}; - for (const item of config["segmentTimes"]) { - unsubmittedSegments[item[0]] = item[1]; - } - - chrome.storage.sync.remove("segmentTimes", () => config.unsubmittedSegments = unsubmittedSegments); - } - - if (!config["exclusive_accessCategoryAdded"] && !config.categorySelections.some((s) => s.name === "exclusive_access")) { - config["exclusive_accessCategoryAdded"] = true; - - config.categorySelections.push({ - name: "exclusive_access" as Category, - option: CategorySkipOption.ShowOverlay - }); - - config.categorySelections = config.categorySelections; - } - - if (config["fillerUpdate"] !== undefined) { - chrome.storage.sync.remove("fillerUpdate"); - } - if (config["highlightCategoryAdded"] !== undefined) { - chrome.storage.sync.remove("highlightCategoryAdded"); - } - if (config["highlightCategoryUpdate"] !== undefined) { - chrome.storage.sync.remove("highlightCategoryUpdate"); - } - - if (config["askAboutUnlistedVideos"]) { - chrome.storage.sync.remove("askAboutUnlistedVideos"); - } - - if (!config["autoSkipOnMusicVideosUpdate"]) { - config["autoSkipOnMusicVideosUpdate"] = true; - for (const selection of config.categorySelections) { - if (selection.name === "music_offtopic" - && selection.option === CategorySkipOption.AutoSkip) { - - config.autoSkipOnMusicVideos = true; - break; - } - } - } - - if (config["disableAutoSkip"]) { - for (const selection of config.categorySelections) { - if (selection.name === "sponsor") { - selection.option = CategorySkipOption.ManualSkip; - - chrome.storage.sync.remove("disableAutoSkip"); - } - } - } - - if (typeof config["skipKeybind"] == "string") { - config["skipKeybind"] = {key: config["skipKeybind"]}; - } - - if (typeof config["startSponsorKeybind"] == "string") { - config["startSponsorKeybind"] = {key: config["startSponsorKeybind"]}; - } - - if (typeof config["submitKeybind"] == "string") { - config["submitKeybind"] = {key: config["submitKeybind"]}; - } - - // Unbind key if it matches a previous one set by the user (should be ordered oldest to newest) - const keybinds = ["skipKeybind", "startSponsorKeybind", "submitKeybind"]; - for (let i = keybinds.length-1; i >= 0; i--) { - for (let j = 0; j < keybinds.length; j++) { - if (i == j) - continue; - if (keybindEquals(config[keybinds[i]], config[keybinds[j]])) - config[keybinds[i]] = null; - } - } - - // Remove some old unused options - if (config["sponsorVideoID"] !== undefined) { - chrome.storage.sync.remove("sponsorVideoID"); - } - if (config["previousVideoID"] !== undefined) { - chrome.storage.sync.remove("previousVideoID"); - } - - // populate invidiousInstances with new instances if 3p support is **DISABLED** - if (!config["supportInvidious"] && config["invidiousInstances"].length !== invidiousList.length) { - config["invidiousInstances"] = invidiousList; - } + // } async function setupConfig() { diff --git a/src/content.ts b/src/content.ts index f591a83b..3eb4a78d 100644 --- a/src/content.ts +++ b/src/content.ts @@ -442,7 +442,7 @@ function cancelSponsorSchedule(): void { /** * @param currentTime Optional if you don't want to use the actual current time */ -function startSponsorSchedule(includeIntersectingSegments = false, currentTime?: number, includeNonIntersectingSegments = true): void { +function startSponsorSchedule(includeIntersectingSegments = true, currentTime?: number, includeNonIntersectingSegments = true): void { cancelSponsorSchedule(); // Don't skip if advert playing and reset last checked time @@ -807,42 +807,20 @@ async function sponsorsLookup(id: string, keepOldSubmissions = true) { cursor = Math.max(cursor, time.segment[1]); } + + if (cursor < video.duration) { + newTimes.push({ + segment: [cursor, video.duration], + source: SponsorSourceType.Local, + actionType: ActionType.Skip, + category: "sponsor" as Category, + UUID: null + }); + } + sponsorTimes = newTimes; } - // Hide all submissions smaller than the minimum duration - if (Config.config.minDuration !== 0) { - for (const segment of sponsorTimes) { - const duration = segment.segment[1] - segment.segment[0]; - if (duration > 0 && duration < Config.config.minDuration) { - segment.hidden = SponsorHideType.MinimumDuration; - } - } - } - - if (keepOldSubmissions) { - for (const segment of oldSegments) { - const otherSegment = sponsorTimes.find((other) => segment.UUID === other.UUID); - if (otherSegment) { - // If they downvoted it, or changed the category, keep it - otherSegment.hidden = segment.hidden; - otherSegment.category = segment.category; - } - } - } - - // See if some segments should be hidden - const downvotedData = Config.local.downvotedSegments[hashPrefix]; - if (downvotedData) { - for (const segment of sponsorTimes) { - const hashedUUID = await utils.getHash(segment.UUID, 1); - const segmentDownvoteData = downvotedData.segments.find((downvote) => downvote.uuid === hashedUUID); - if (segmentDownvoteData) { - segment.hidden = segmentDownvoteData.hidden; - } - } - } - startSkipScheduleCheckingForStartSponsors(); //update the preview bar @@ -860,14 +838,7 @@ async function sponsorsLookup(id: string, keepOldSubmissions = true) { } function getEnabledActionTypes(): ActionType[] { - const actionTypes = [ActionType.Skip, ActionType.Poi]; - if (Config.config.muteSegments) { - actionTypes.push(ActionType.Mute); - } - if (Config.config.fullVideoSegments) { - actionTypes.push(ActionType.Full); - } - + const actionTypes = [ActionType.Skip, ActionType.Mute]; return actionTypes; } @@ -1521,40 +1492,6 @@ async function updateVisibilityOfPlayerControlsButton(): Promise { function updateEditButtonsOnPlayer(): void { // Don't try to update the buttons if we aren't on a YouTube video page if (!sponsorVideoID || onMobileYouTube) return; - - const buttonsEnabled = !Config.config.hideVideoPlayerControls && !onInvidious; - - let creatingSegment = false; - let submitButtonVisible = false; - let deleteButtonVisible = false; - - // Only check if buttons should be visible if they're enabled - if (buttonsEnabled) { - creatingSegment = isSegmentCreationInProgress(); - - // Show only if there are any segments to submit - submitButtonVisible = sponsorTimesSubmitting.length > 0; - - // Show only if there are any segments to delete - deleteButtonVisible = sponsorTimesSubmitting.length > 1 || (sponsorTimesSubmitting.length > 0 && !creatingSegment); - } - - // Update the elements - playerButtons.startSegment.button.style.display = buttonsEnabled ? "unset" : "none"; - playerButtons.cancelSegment.button.style.display = buttonsEnabled && creatingSegment ? "unset" : "none"; - - if (buttonsEnabled) { - if (creatingSegment) { - playerButtons.startSegment.image.src = chrome.extension.getURL("icons/PlayerStopIconSponsorBlocker.svg"); - playerButtons.startSegment.button.setAttribute("title", chrome.i18n.getMessage("sponsorEnd")); - } else { - playerButtons.startSegment.image.src = chrome.extension.getURL("icons/PlayerStartIconSponsorBlocker.svg"); - playerButtons.startSegment.button.setAttribute("title", chrome.i18n.getMessage("sponsorStart")); - } - } - - playerButtons.submit.button.style.display = submitButtonVisible && !Config.config.hideUploadButtonPlayerControls ? "unset" : "none"; - playerButtons.delete.button.style.display = deleteButtonVisible && !Config.config.hideDeleteButtonPlayerControls ? "unset" : "none"; } /** @@ -1900,9 +1837,9 @@ function submitSponsorTimes() { return; } - if (sponsorTimesSubmitting !== undefined && sponsorTimesSubmitting.length > 0) { - submissionNotice = new SubmissionNotice(skipNoticeContentContainer, sendSubmitMessage); - } + // if (sponsorTimesSubmitting !== undefined && sponsorTimesSubmitting.length > 0) { + // submissionNotice = new SubmissionNotice(skipNoticeContentContainer, sendSubmitMessage); + // } } diff --git a/src/popup.ts b/src/popup.ts index cbf92917..33dbeb54 100644 --- a/src/popup.ts +++ b/src/popup.ts @@ -114,12 +114,6 @@ async function runThePopup(messageListener?: MessageListener): Promise { "sbCloseDonate" ].forEach(id => PageElements[id] = document.getElementById(id)); - // Hide donate button if wanted (Safari, or user choice) - if (!showDonationLink()) { - PageElements.sbDonate.style.display = "none"; - } - PageElements.sbDonate.addEventListener("click", () => Config.config.donateClicked = Config.config.donateClicked + 1); - //setup click listeners PageElements.sponsorStart.addEventListener("click", sendSponsorStartMessage); PageElements.whitelistToggle.addEventListener("change", function () { @@ -297,7 +291,7 @@ async function runThePopup(messageListener?: MessageListener): Promise { if (request != undefined) { //remove loading text PageElements.mainControls.style.display = "flex"; - if (request.onMobileYouTube) PageElements.mainControls.classList.add("hidden"); + PageElements.mainControls.classList.add("hidden"); PageElements.whitelistButton.classList.remove("hidden"); PageElements.loadingIndicator.style.display = "none";