aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/content.ts
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2021-08-20 03:54:49 -0400
committerAjay Ramachandran <[email protected]>2021-08-20 03:54:49 -0400
commitd089e43b8a03e8a4b1b95a83c044561cfc0290e8 (patch)
treec1baebd3fb89790859d39996e7bf8f77d43ace94 /src/content.ts
parentb3336a218e5b5fd7bb828ad6c2b022670d45638a (diff)
downloadSponsorBlock-d089e43b8a03e8a4b1b95a83c044561cfc0290e8.tar.gz
SponsorBlock-d089e43b8a03e8a4b1b95a83c044561cfc0290e8.zip
Add tooltip about highlight feature
Diffstat (limited to 'src/content.ts')
-rw-r--r--src/content.ts15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/content.ts b/src/content.ts
index 804af61d..46a1a1c5 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -15,6 +15,7 @@ import { Message, MessageResponse } from "./messageTypes";
import * as Chat from "./js-components/chat";
import { getCategoryActionType } from "./utils/categoryUtils";
import { SkipButtonControlBar } from "./js-components/skipButtonControlBar";
+import { Tooltip } from "./render/Tooltip";
// Hack to get the CSS loaded on permission-based sites (Invidious)
utils.wait(() => Config.config !== null, 5000, 10).then(addCSS);
@@ -1104,7 +1105,19 @@ function skipToTime({v, skipTime, skippingSegments, openNotice, forceAutoSkip, u
if (!autoSkip
&& skippingSegments.length === 1
&& getCategoryActionType(skippingSegments[0].category) === CategoryActionType.POI) {
- skipButtonControlBar.enable(skippingSegments[0]);
+ skipButtonControlBar.enable(skippingSegments[0], !Config.config.highlightCategoryUpdate ? 15 : 0);
+
+ if (!Config.config.highlightCategoryUpdate) {
+ new Tooltip({
+ text: chrome.i18n.getMessage("highlightNewFeature"),
+ link: "https://blog.ajay.app/highlight-sponsorblock",
+ referenceNode: skipButtonControlBar.getElement().parentElement,
+ prependElement: skipButtonControlBar.getElement(),
+ timeout: 15
+ });
+
+ Config.config.highlightCategoryUpdate = true;
+ }
activeSkipKeybindElement?.setShowKeybindHint(false);
activeSkipKeybindElement = skipButtonControlBar;