Possibility to add a new feature to AutoPilot?

I have some digital content I have purchased, and to back it up I’d like to use the Archive.web browser extension.

The content has articles that popup on a hover over certain elements, currently Autopilot does not pick them up itself (unless it’s scroll gets lucky).

I have managed to put together some shoddy javascript I can punch into chrome’s console, It iterates through unique hover elements to trigger the mouseover event.

Is this something that could be built into AutoPilot ?

//sleep routine to allow download of objects
const sleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay))

//create mouseover event to trigger hover element
async function RunMouseOver(ToolTip) {
  ToolTip.dispatchEvent(new MouseEvent('mouseover'))
}
//create mouseleave event to clear hover element
async function RunMouseleave(ToolTip) {
  ToolTip.dispatchEvent(new MouseEvent('mouseout'))
}

//Identify all nodes with a tooltip hover class
//const classList = [ ".tooltip", ".hover", ".tooltip-hover" ]
const classList = [ ".tooltip-hover" ]
const nodeList = document.querySelectorAll(classList)

//create a sorted and unique list of nodes
nodeListSorted = [...new Set(nodeList)].sort()
uniqueAndSorted = new Array()
uniqueAndSorted.push( nodeListSorted[0] )

//iterate all nodes and select unique links
for ( let i = 1; i < nodeListSorted.length ; i++ ) {
  if ( uniqueAndSorted.findIndex( node => node.href === nodeListSorted[i].href ) < 0 )
  {
    uniqueAndSorted.push( nodeListSorted[i] )
  }
}

//load each tooltip with a delay to allow the objects to download
( async function () {
    i = 0 ;
    for await ( Node of uniqueAndSorted ) {
      RunMouseOver(Node);
      //console.log(i) ; i++
      await sleep( 4000 );
      RunMouseleave(Node);
    }
})();

Hey sorry for the lack of response on this one. Cool that you were able to script this!

Autopilot in ArchiveWeb.page isn’t our current focus right now, but in general the answer as to if more could be added is yes! You may also be interested in the browsertrix-behaviors repo

As @Hank indicated, if you are able to switch to using browsertrix-crawler you could bundle up your JavaScript so that it can be recognized as a custom behavior. You won’t be able to intervene into the interaction itself, but you can watch the activity through a screencast, which is often very helpful.

Someday it would be pretty cool to be able to tell ArchiveWebPage to use a custom behavior. AWP would actually be a useful tool when developing the behavior, to test it out.

Thanks team,

Yes I mostly managed to get the script working in the console (though have been flagged for scraping so i need to add some randomness to it / delay the captures).

I did see browsertrix, but was not sure i wanted to get into setting that up right now, perhaps I should.