Hacker News new | ask | show | jobs
by ghostly_s 2821 days ago
Shortcuts can "parse JS from a web page"? Can you explain how that's possible? None of the examples you listed seem to involve direct access to page content.
1 comments

Here's the JS for PiP video, the shortcut command is "Run JS in web page":

  var videos = document.getElementsByTagName("video");
  if (videos) {
    var video = videos[0];
        video.webkitSetPresentationMode(video.webkitPresentationMode === "picture-in-picture" ? "inline" : "picture-in-picture");
  }

  completion({"success": true});