Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ArtskydJ/95ae630a76ae13183066cd29936e934d to your computer and use it in GitHub Desktop.
Save ArtskydJ/95ae630a76ae13183066cd29936e934d to your computer and use it in GitHub Desktop.

We can make Shipstations's "View address" dropdown automatically open with a bit of JavaScript.

There are browser extensions that you can type a bit of JS into, and they will run the JS every time that site is visited.

There are a bunch of extensions with varying levels of complexity.

To make the View-address dropdown auto-open...

  1. Install your browser extension of choice
  2. Navigate to https://ship6.shipstation.com/scan
  3. Paste the following code into the extension:

javascript

const auto_open_the_address_dropdown = "yes";
// Refresh the browser page if you change "no" or "yes" above

// DO NOT CHANGE ANYTHING BELOW HERE
const qry_all = s => Array.from(document.querySelectorAll(s))
if (auto_open_the_address_dropdown.toLowerCase() === 'yes') {
	let prev_view_btn = null
	setInterval(() => {
		if (location.pathname !== '/scan') return;
		const view_btn = qry_all('.dropdown-toggler')
			.filter(e => e.textContent === 'View')[0]
		if (!view_btn || view_btn === prev_view_btn) return;
		(prev_view_btn = view_btn).click()
	}, 100)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment