Trying to create a key to display hints on youtube videos and add them to watch later playlist #2191
Unanswered
Fred-Vatin
asked this question in
Q&A
Replies: 1 comment
-
Hello @b0o, I saw you’re pretty skilled with SurfingKeys and maybe browser extensions in general. Would you have a hint to share about this error. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Goal
For instance, while you’re at https://www.youtube.com/feed/subscriptions, a key would display a hint on every visible videos
#action ytd-thumbnail
then add them to watch later playlist.The problem is the watch later button only insert in the DOM on a mouseover event. When breaking on the node
#hover-overlays
, we can access the button atytd-thumbnail-overlay-toggle-button-renderer[aria-label="Watch later"]
.Running the code
Fortunately, this extension exists. It works perfectly. But his goal is to add the current playing video to the watch later playlist. So I converted this as a function that should work with SurfingKeys and do what I want. It pretends to be Youtube to send a valid request.
Here is the code:
Unfortunately, when running the action on any valid YouTube page like https://www.youtube.com/feed/subscriptions the console returns this error:
It is as if my function doesn’t to run with the same permission set in the youtube-watch-later-shortcut-ext manifest.
But SurfingKeys has also those permissions in its manifest v3 (used in chrome) or equivalent in v2 (Firefox which I currently use).
insertJS
I tried to use insertJS api.
executeYouTubeCommand
is executed but I think I use this the wrong way because same permission denied error and the<script>
added is empty and undefined.Failed to load element <script> where source is “https://www.youtube.com/feed/undefined”.
The onload function doesn’t run.
Permission denied error again if I use:
But the onload function is executed.
Runtime
I tried
Same permission error. Code is supposed to be a string but if I run:
the function is not executed. Only the callback runs.
Even if I put the function definition like:
Beta Was this translation helpful? Give feedback.
All reactions