Save the following bookmarklet as a bookmark
Honeycomb Environment Switcher
(() => { | |
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); | |
})(); |