Execute quick commands by Javascript

  • If quick commands were available with Javascript function names, complex commands with bookmarklets or page actions could easily be issued.

    Example usages:

    It would be best to be able to add bookmarklets or page actions as buttons to the Vivaldi interface and access them with keyboard shortcuts or mouse gestures, but this is another feature request.

    My own experience: I tried to access Vivaldi's internal methods from page actions and bookmarklet as well, but failed.


  • @bimlas That’s already possible, you can run page actions. But it would be nice, if they could be saved outside the application. They also work with quick commands. And of course we can create buttons and run code on a site with a simple mod.

  • @luetage ,

    For example, can I call page cloning and mosaic view in Page actions? Are quick actions available through Javascript functions? If yes, where can I find the list of available functions?

  • @bimlas Page actions are in the statusbar. They get loaded from a folder inside the application. As soon as you add a valid file to that folder it will be accessible as page action.

  • @luetage

    I understand how they work, but the feature request also applies to making quick actions (F2) commands available with Javascript calls. I ask if this is already possible?

  • @luetage But page actions can only run on the page.

    This request is basically about adding JS functions to control Vivaldi & allowing JS w/ them to be executed like other commands (the problem of the current implementation is that

    • custom parameters are only allowed in the QC & sometimes menus (not for keyboard shortcuts & MGs)
    • the QC can only run one command at a time).

  • @potmeklecbohdan Hmm, the request mentions bookmarklets, which are only invoked on the current site and only one at a time. That’s page actions, which are accessible from quick commands.

  • @luetage

    Control Vivaldi with bookmarklets

    • Vivaldi — the browser
    • bookmarklets — JS code that can contain more than 1 function call

  • @potmeklecbohdan Bookmarklets is a misleading term for that. To me bookmarklets run on a webpage and don’t influence the UI at all.

  • @luetage

    I think @potmeklecbohdan can better express what I mean. Sorry for the ambiguity: the goal is to be able to access Vivaldi's custom actions via Javascript without modifying the installed app itself. I thought this was possible with the help of bookmarklets, but maybe page actions might be the solution. In any case, it doesn't seem feasible to use custom actions with Javascript function calls in either case.


    I modified the topic opening post and topic title to make it clearer.

  • I wrote a simple script that clones the current page. This works if I issue commands in Vivaldi's own DevTools, but it doesn't work when started from page actions, so it's probably not possible to implement this feature request because Vivaldi's internal functions aren't available from page actions or bookmarklets either.

    var currentTab = document.querySelector('#webpage-stack div.active.visible');
    var tabId = parseInt(currentTab.getAttribute('data-id'));

  • @bimlas Both execute like the website's original code, with no (AFAIK) additional context, so it makes sense that you cannot do this.

    On the other hand, you can window.open(location.href)

Log in to reply

Looks like your connection to Vivaldi Forum was lost, please wait while we try to reconnect.