Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shopify Dev Toolkit

A single Chrome extension combining two dev-workflow utilities for Shopify stores:

  1. Password Autofill — auto-fills and submits the storefront password on a password-protected dev store, and (unlike Shopify's own behavior) sends you back to the page you actually wanted instead of dumping you on the homepage.
  2. Cart Cleaner — one-click clearing of the current store's cart via /cart/clear.js.

Installation

  1. chrome://extensions → enable Developer modeLoad unpacked → select this folder.
  2. Click the extension icon in the toolbar. There are two tabs: Password and Cart Cleaner.

Password tab

  1. Type your dev store's password and click Save. It's stored in chrome.storage.local, scoped to this extension.
  2. Visit any password-protected page on *.myshopify.com — the form fills and submits automatically, then you're redirected to the page you were trying to reach (not the homepage).

If your store is on a custom domain instead of *.myshopify.com, update both host_permissions and content_scripts.matches in manifest.json to include it.

Retry limit

To avoid tripping Shopify's "Too many failed attempts" rate limit, the extension stops auto-submitting after 3 consecutive failed attempts with the saved password:

  • A red banner appears on the page explaining it stopped, with a "Reset & retry" button.
  • The popup's Password tab also shows a live n/3 failed attempts status.
  • Saving a new (corrected) password from the popup automatically resets the counter back to 0.
  • A successful login also resets the counter to 0.

How the redirect-back logic works

Shopify's password checkpoint doesn't preserve the page you wanted anywhere retrievable after auth — it just always lands you on /. So:

  • chrome.webNavigation.onBeforeNavigate captures the URL you actually typed/clicked, before Shopify's redirect can drop it.
  • When the content script auto-submits the password form, that captured URL is locked in as the "page to return to."
  • The next time that tab commits a navigation to /, the extension knows that's Shopify's hardcoded bounce, and immediately sends the tab on to the locked-in target instead.

State lives in chrome.storage.session (not plain JS variables) so it survives MV3 service worker restarts.

Debugging: chrome://extensions → this extension → service worker → Inspect, then reproduce the issue and watch for [pw-autofill] log lines.

Cart Cleaner tab

  1. Navigate to any Shopify store.
  2. Open the popup, switch to the Cart Cleaner tab.
  3. Confirm the detected store URL, then click Clear Cart. The tab reloads once the cart is cleared.

Files

  • manifest.json — combined permissions/config for both features.
  • background.js — password redirect-tracking logic (service worker).
  • content.js — detects and auto-submits the password form.
  • popup.html / popup.js — tabbed UI for both features.
  • icon.png — extension icon.

Notes & limitations

  • The password lives in chrome.storage.local. Fine for a personal dev tool on your own machine; don't publish or share this folder with the password filled in, since anyone with popup access can reveal it via "Show password."
  • Cart Cleaner relies on /cart/clear.js, a standard Shopify storefront endpoint — it only works on pages of the same Shopify domain (uses activeTab + scripting).

License

MIT

About

Shopify toolkit

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages