This will toggle between the staging
and production
environments by default. Adjust the naming if that isn't what yours are called.
Create a bookmark named "Honeycomb Environment Switcher"
Set the target URL as the following, which is the content from full.js
with newlines and indents removed.
javascript:(() => {const f = (tag, text) =>Array.from(document.querySelectorAll(tag)).find((el) => el.textContent === text,);f('button', 'Share').click();setTimeout(() => {f('button', 'Get Template Link').click();setTimeout(() => {const h = f('h4', 'Query Template Link');let url = h.closest('section').querySelector('textarea').value;const swap = ['/production/', '/staging/'];if (url.includes('/staging/')) swap.reverse();url = url.replace(...swap);location.href = url;}, 10);}, 10);})();
When you click this bookmark from a query page, you'll be switched to the same query but run against the other environment.