Skip to content

Instantly share code, notes, and snippets.

@zacharysyoung
Created November 7, 2023 04:38
Show Gist options
  • Save zacharysyoung/d8498aecabd42ffbe3778522fbf4b25a to your computer and use it in GitHub Desktop.
Save zacharysyoung/d8498aecabd42ffbe3778522fbf4b25a to your computer and use it in GitHub Desktop.
Open multiple tabs from JavaScript
/**
* Make sure to check in the tab you run this script from
* for any kind of notification about pop-ups being blocked
* then allow for this site/page only.
*
* https://stackoverflow.com/questions/63237482/open-multiple-tabs-with-javascript
*/
const anchors = document.getElementsByTagName('a');
for (let x of anchors) {
if (x.href.includes('forms') && !(x.href.includes('x_role_id'))) {
window.open(x.href, '_blank');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment