Skip to content

Instantly share code, notes, and snippets.

@KarllosSouza
Last active August 17, 2020 13:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KarllosSouza/8ff699d46d238caff4c746b776fddea6 to your computer and use it in GitHub Desktop.
Save KarllosSouza/8ff699d46d238caff4c746b776fddea6 to your computer and use it in GitHub Desktop.
Useful snippets to test the NomadGoods pages.
// GoTo ProductPage
javascript:window.open(`https://nomad.frontend.getshogun.com/products/${document.querySelector('p[class*=Text__Heading').innerText}`,'_blank');
// Switch between 'nomadgoods.com' and 'nomad.frontend.getshogun.com'
javascript:(function(){if(window.location.href.includes('nomadgoods.com')){const url=window.location.href.replace('nomadgoods','nomad.frontend.getshogun');window.location.replace(url);}if(window.location.href.includes('nomad.frontend.getshogun.com')){const url=window.location.href.replace('nomad.frontend.getshogun','nomadgoods');window.location.replace(url);}})();
// HubApp FullScreen
javascript:(function(){if(!document.querySelector('#__next > div > main > div:last-child > div').style.position){document.querySelector('#__next > div > main > div:last-child > div').style.position='absolute';document.querySelector('div[class*="LivePreview__IframeContainer"]').style.borderWidth=0;}else{ document.querySelector('#__next > div > main > div:last-child > div').style.position='';document.querySelector('div[class*="LivePreview__IframeContainer"]').style.borderWidth='1px';}})();
// HubApp "380px"
javascript:(function(){document.querySelector('#live-preview-iframe').style.width='395px';})();
// Remove the header
javascript:(function(){if(window.location.href.includes('nomadgoods.com')){document.querySelector('#shopify-section-header').remove();document.querySelector('#shopify-section-product-template').remove();}if(window.location.href.includes('nomad.frontend.getshogun.com')){document.querySelector('header').remove();document.querySelector('.CartDrawer').remove();document.querySelector('.ProductStickyAddToCart').remove();document.querySelector('.ProductBox').remove();}})();
// Remove the first section
javascript:(function(){if(window.location.href.includes('nomadgoods.com')){document.querySelector('.shg-box-content div:first-child').remove();}if(window.location.href.includes('nomad.frontend.getshogun.com')){document.querySelector('#frontend-root div:first-child').remove();}})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment