I built this as a Chrome extension (it also works in Edge). On a single order page, one click or Ctrl+Shift+Y copies the customer name, order number, total and shipping city as one line you can paste into Google Sheets, and a "Copied!" message appears. Nothing leaves your browser.
1. What this does
- On a single order page (
https://admin.brightleafgoods.com/orders/…), you click the toolbar button or press Ctrl+Shift+Y (Cmd+Shift+Y on Mac). - It reads the customer's full name, order number, order total and shipping city from the page and copies them as one tab-separated line, for example:
Jordan Ellis⇥#10482⇥$84.50⇥Portland. - When you paste into Google Sheets, each value lands in its own column, in this order: A Name, B Order #, C Total, D City.
- A small "Copied!" message appears at the bottom-right of the page. If something can't be found, a friendly message says exactly what was missing.
- Nothing is sent anywhere. The extension makes no network requests, saves nothing, and only runs on your order pages when you trigger it.
2. Format chosen and why
I chose a Chrome extension (Manifest V3). A bookmarklet can't have a keyboard shortcut like Ctrl+Shift+Y, and an extension can. The same unpacked folder installs in both Google Chrome and Microsoft Edge, because both use the same Manifest V3 format.
If your company blocks extensions you install yourself, a click-only bookmarklet version (no shortcut) is a good fallback. You can ask for it with your one free change request.
3. Files
brightleaf-order-copier/
├── manifest.json ← tells the browser what the extension is and what it may do
├── background.js ← listens for the click/shortcut and checks you're on an order page
└── copy-order.js ← reads the order details, copies them, shows the "Copied!" message
manifest.json
{
"manifest_version": 3,
"name": "Brightleaf Order Copier",
"version": "1.0.0",
"description": "Copies customer name, order number, total and shipping city from a Brightleaf order page as one tab-separated line for Google Sheets.",
"permissions": ["activeTab", "scripting", "clipboardWrite"],
"background": {
"service_worker": "background.js"
},
"action": {
"default_title": "Copy order line for Google Sheets (Ctrl+Shift+Y)"
},
"commands": {
"copy-order-line": {
"suggested_key": {
"default": "Ctrl+Shift+Y",
"mac": "Command+Shift+Y"
},
"description": "Copy order line for Google Sheets"
}
}
}
background.js
// background.js
// This runs quietly in the background. It waits for you to either
// (a) click the extension's toolbar button, or (b) press the keyboard shortcut.
// Then it checks you're on a Brightleaf order page and runs copy-order.js on it.
// It never sends anything over the internet.
// Only pages whose address starts like this are allowed.
// Example match: https://admin.brightleafgoods.com/orders/10482
const ORDER_PAGE_PATTERN = /^https:\/\/admin\.brightleafgoods\.com\/orders\/.+/;
const DEFAULT_TITLE = "Copy order line for Google Sheets (Ctrl+Shift+Y)";
// Shows a small red "!" on the toolbar icon for a few seconds,
// with an explanation when you hover over the icon.
function flashBadge(tabId, message) {
const ignore = () => {}; // ignore errors (for example, if the tab was closed)
chrome.action.setBadgeBackgroundColor({ tabId, color: "#B00020" }).catch(ignore);
chrome.action.setBadgeText({ tabId, text: "!" }).catch(ignore);
chrome.action.setTitle({ tabId, title: message }).catch(ignore);
setTimeout(() => {
chrome.action.setBadgeText({ tabId, text: "" }).catch(ignore);
chrome.action.setTitle({ tabId, title: DEFAULT_TITLE }).catch(ignore);
}, 4000);
}
// The main action: check the page, then run the copy script on it.
async function copyFromTab(tab) {
if (!tab || typeof tab.id !== "number") return;
// Don't touch any page that isn't a Brightleaf order page.
if (!tab.url || !ORDER_PAGE_PATTERN.test(tab.url)) {
flashBadge(
tab.id,
"Order Copier only works on a single order page (admin.brightleafgoods.com/orders/...)."
);
return;
}
try {
await chrome.scripting.executeScript({
target: { tabId: tab.id },
files: ["copy-order.js"]
});
} catch (error) {
console.error("Order Copier could not run on this page:", error);
flashBadge(tab.id, "Order Copier couldn't run here. Try reloading the page and pressing it again.");
}
}
// (a) Toolbar button clicked.
chrome.action.onClicked.addListener((tab) => {
copyFromTab(tab);
});
// (b) Keyboard shortcut pressed.
chrome.commands.onCommand.addListener(async (command, tab) => {
if (command !== "copy-order-line") return;
// Normally the browser tells us which tab is open. If it doesn't, look it up.
if (!tab) {
const [activeTab] = await chrome.tabs.query({ active: true, currentWindow: true });
tab = activeTab;
}
copyFromTab(tab);
});
copy-order.js
// copy-order.js
// This runs on the order page only when you click the button or press the shortcut.
// It finds the four pieces of information, joins them with tabs, copies the
// result to your clipboard, and shows a small "Copied!" message.
// Everything is wrapped in ( ... )() so it can safely run again and again.
(() => {
"use strict";
// ===================================================================
// CONFIG: the only part you might ever need to edit.
// "Selectors" tell the script where on the page each value lives.
// Each field has a list. The script tries them in order and uses the
// first one that finds text. The first selector in each list matches
// the HTML you sent us. The others are backups in case the page changes.
// ===================================================================
const CONFIG = {
selectors: {
// <h1 data-testid="order-number">O