Skip to content

Instantly share code, notes, and snippets.

@jtarchie
Created January 14, 2021 00:22
Show Gist options
  • Save jtarchie/793b904d4f7c1b5cb0791e6d3a6dc15d to your computer and use it in GitHub Desktop.
Save jtarchie/793b904d4f7c1b5cb0791e6d3a6dc15d to your computer and use it in GitHub Desktop.
function e(name) {
var e = document.createEvent('HTMLEvents');
e.initEvent('name', true, false);
return e;
}
var element = $$("span[title='View']")[0]
element.dispatchEvent(e("contextmenu"));
element = $$("div[data-automation-id='ciewPrintableVersion']")[0]
element.dispatchEvent(new PointerEvent('pointerdown'));
element.dispatchEvent(new PointerEvent('pointerup'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment