Add files via upload

This commit is contained in:
Christian
2026-05-19 18:40:27 -04:00
committed by GitHub
parent 5487dba286
commit 1c01e33400
5 changed files with 2021 additions and 0 deletions
+67
View File
@@ -0,0 +1,67 @@
# Portage
**Browser Transitioning Tool** by [pvrz](https://github.com/pvrzz)
Bulk-migrate chrome extensions and cookies between chromium browsers. Opens chrome web store pages in labeled tab groups for extensions, and provides encrypted JSON export/import for cookies.
```
github: https://github.com/pvrzz/browserport
```
## install (load unpacked)
1. unzip somewhere stable (chrome points at the folder, not a copy)
2. open `chrome://extensions`
3. enable developer mode (top right)
4. click "load unpacked" and select the folder
5. pin Portage from the puzzle icon
## features
**two-pane interface** — top tabs switch between extensions and cookies. each has installed/imported sub-tabs.
**extensions** — select the ones you want, "open in tab group" opens all their chrome web store install pages in a labeled cyan tab group. drag the group title to detach into its own window. cross-machine works via an HTML export that's also a standalone clickable page.
**cookies** — grouped by domain, expand to inspect individual cookies (with secure/httpOnly/session flags). export as JSON with optional AES-GCM encryption (passphrase-protected via PBKDF2). import reads the same format and applies cookies back to the browser, preserving security flags.
## encryption details
- PBKDF2 with SHA-256, 250,000 iterations
- AES-GCM 256-bit
- 128-bit random salt, 96-bit random IV per export
- format declares algorithm and parameters for forward compatibility
- runs entirely in your browser via Web Crypto API, no library deps
## permissions
| permission | reason |
|---|---|
| `management` | list installed extensions |
| `tabs` + `tabGroups` | create the install tab group |
| `downloads` | save export files |
| `cookies` | read and write cookies for migration |
| `<all_urls>` | required for cookies api to access all domains |
no network access, no remote scripts, no analytics. ~1030 lines across 5 files, all local.
## file structure
```
portage/
├── manifest.json mv3 manifest
├── popup.html ui structure
├── popup.css styles
├── popup.js logic + crypto
└── icons/ 16/48/128 png
```
## known limits
- popup closes when it loses focus during operations — don't click outside mid-encryption
- cookies file is essentially session tokens. always encrypt for transfer, never send or email; especially when it's unencrypted
- some sites use device fingerprinting or token rebinding that defeats cookie migration. re-login on important services (banking, financial, work portals)
- sideloaded/dev-mode extensions show a "sideload" badge — they won't have web store pages
## license
MIT-style: do whatever, attribute if you fork.
+32
View File
@@ -0,0 +1,32 @@
{
"manifest_version": 3,
"name": "Portage",
"version": "1.0.0",
"description": "Portage - Browser Transitioning Tool. Migrate extensions and cookies between chromium browsers with encrypted exports.",
"author": "pvrz",
"homepage_url": "https://github.com/pvrzz/portage",
"permissions": [
"management",
"tabs",
"tabGroups",
"downloads",
"cookies"
],
"host_permissions": [
"<all_urls>"
],
"action": {
"default_popup": "popup.html",
"default_title": "Portage",
"default_icon": {
"16": "icons/icon16.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
}
},
"icons": {
"16": "icons/icon16.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
}
}
+751
View File
@@ -0,0 +1,751 @@
/*
---------------------------------------
portage by pvrz
github: https://github.com/pvrzz/portage
file name: popup.css
---------------------------------------
*/
:root {
--bg: #0e1014;
--surface: #181b22;
--surface-2: #1f242d;
--border: #2a2f3a;
--border-strong: #3a4150;
--text: #e8eaef;
--text-dim: #a4abbc;
--text-muted: #6b7387;
--accent: #5eead4;
--accent-dim: #2dd4bf;
--accent-bg: rgba(94, 234, 212, 0.08);
--danger: #f87171;
--warn: #fbbf24;
--radius: 8px;
--radius-sm: 5px;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html, body {
width: 380px;
background: var(--bg);
color: var(--text);
font-family: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;
font-size: 13px;
line-height: 1.45;
-webkit-font-smoothing: antialiased;
}
.app {
display: flex;
flex-direction: column;
max-height: 600px;
}
/*
---------------------------------------
header
---------------------------------------
*/
.header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px 16px 12px;
border-bottom: 1px solid var(--border);
}
.header-left {
display: flex;
align-items: center;
gap: 10px;
}
.logo {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border-radius: var(--radius-sm);
background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
color: var(--bg);
}
.title-block h1 {
font-size: 13px;
font-weight: 600;
letter-spacing: -0.01em;
}
.subtitle {
font-size: 11px;
color: var(--text-muted);
margin-top: 1px;
}
.icon-btn {
display: flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
border: 1px solid var(--border);
background: transparent;
border-radius: var(--radius-sm);
color: var(--text-dim);
cursor: pointer;
transition: all 0.15s ease;
}
.icon-btn:hover {
background: var(--surface);
color: var(--text);
border-color: var(--border-strong);
}
.icon-btn:active {
transform: scale(0.95);
}
/*
---------------------------------------
type tabs and mode tabs
---------------------------------------
*/
.type-tabs {
display: flex;
padding: 8px 12px 0;
gap: 4px;
background: var(--bg);
}
.type-tab {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
padding: 8px 0;
background: var(--surface);
border: 1px solid var(--border);
color: var(--text-dim);
font-size: 12px;
font-weight: 500;
cursor: pointer;
border-radius: var(--radius-sm) var(--radius-sm) 0 0;
border-bottom: none;
transition: all 0.15s ease;
font-family: inherit;
}
.type-tab:hover {
color: var(--text);
}
.type-tab.active {
background: var(--accent-bg);
color: var(--accent);
border-color: var(--accent);
}
.mode-tabs {
display: flex;
padding: 0 16px;
border-bottom: 1px solid var(--border);
background: var(--bg);
}
.mode-tab {
flex: 1;
padding: 10px 0;
background: transparent;
border: none;
color: var(--text-muted);
font-size: 12px;
font-weight: 500;
cursor: pointer;
border-bottom: 2px solid transparent;
transition: all 0.15s ease;
font-family: inherit;
}
.mode-tab:hover {
color: var(--text-dim);
}
.mode-tab.active {
color: var(--accent);
border-bottom-color: var(--accent);
}
/*
---------------------------------------
selection bar
---------------------------------------
*/
.selection-bar {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 16px;
background: var(--surface);
border-bottom: 1px solid var(--border);
font-size: 11px;
}
.count {
color: var(--text-dim);
font-variant-numeric: tabular-nums;
}
.count span {
color: var(--accent);
font-weight: 600;
}
.selection-actions {
display: flex;
gap: 4px;
}
.text-btn {
padding: 4px 8px;
background: transparent;
border: 1px solid var(--border);
border-radius: 4px;
color: var(--text-dim);
font-size: 11px;
cursor: pointer;
font-family: inherit;
transition: all 0.15s ease;
}
.text-btn:hover {
background: var(--surface-2);
color: var(--text);
border-color: var(--border-strong);
}
/*
---------------------------------------
list and items
---------------------------------------
*/
.list-container {
flex: 1;
overflow-y: auto;
min-height: 200px;
max-height: 380px;
}
.list-container::-webkit-scrollbar {
width: 8px;
}
.list-container::-webkit-scrollbar-track {
background: transparent;
}
.list-container::-webkit-scrollbar-thumb {
background: var(--border);
border-radius: 4px;
}
.list-container::-webkit-scrollbar-thumb:hover {
background: var(--border-strong);
}
.ext-list {
list-style: none;
}
.ext-item {
display: flex;
align-items: center;
gap: 10px;
padding: 9px 16px;
border-bottom: 1px solid var(--border);
cursor: pointer;
transition: background 0.1s ease;
}
.ext-item:hover {
background: var(--surface);
}
.ext-item.selected {
background: var(--accent-bg);
}
.ext-checkbox {
appearance: none;
width: 16px;
height: 16px;
border: 1.5px solid var(--border-strong);
border-radius: 4px;
background: var(--surface-2);
cursor: pointer;
position: relative;
flex-shrink: 0;
transition: all 0.15s ease;
}
.ext-checkbox:hover {
border-color: var(--accent);
}
.ext-checkbox:checked {
background: var(--accent);
border-color: var(--accent);
}
.ext-checkbox:checked::after {
content: '';
position: absolute;
left: 4px;
top: 1px;
width: 5px;
height: 9px;
border: solid var(--bg);
border-width: 0 2px 2px 0;
transform: rotate(45deg);
}
.ext-icon {
width: 24px;
height: 24px;
border-radius: 4px;
flex-shrink: 0;
background: var(--surface-2);
}
.ext-info {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 2px;
}
.ext-name {
font-size: 12.5px;
font-weight: 500;
color: var(--text);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.ext-meta {
display: flex;
gap: 8px;
align-items: center;
font-size: 10.5px;
color: var(--text-muted);
font-family: ui-monospace, "SF Mono", "Cascadia Code", monospace;
}
.ext-id {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 130px;
}
.badge {
padding: 1px 5px;
border-radius: 3px;
font-size: 9px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.04em;
font-family: system-ui, sans-serif;
}
.badge-disabled {
background: rgba(248, 113, 113, 0.15);
color: var(--danger);
}
.badge-sideload {
background: rgba(251, 191, 36, 0.15);
color: var(--warn);
}
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 40px 20px;
text-align: center;
color: var(--text-dim);
gap: 4px;
}
.empty-state .muted {
color: var(--text-muted);
font-size: 11px;
}
.hidden {
display: none !important;
}
/*
---------------------------------------
footer and action buttons
---------------------------------------
*/
.footer {
display: flex;
flex-direction: column;
gap: 8px;
padding: 12px 16px;
background: var(--surface);
border-top: 1px solid var(--border);
}
.primary-btn {
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
padding: 9px 12px;
background: var(--accent);
color: var(--bg);
border: none;
border-radius: var(--radius-sm);
font-size: 12.5px;
font-weight: 600;
cursor: pointer;
font-family: inherit;
transition: all 0.15s ease;
}
.primary-btn:hover:not(:disabled) {
background: var(--accent-dim);
transform: translateY(-1px);
}
.primary-btn:active:not(:disabled) {
transform: translateY(0);
}
.primary-btn:disabled {
background: var(--surface-2);
color: var(--text-muted);
cursor: not-allowed;
}
.secondary-actions {
display: flex;
gap: 8px;
}
.secondary-btn {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
gap: 5px;
padding: 7px 10px;
background: var(--surface-2);
color: var(--text-dim);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
font-size: 11.5px;
cursor: pointer;
font-family: inherit;
transition: all 0.15s ease;
}
.secondary-btn:hover {
background: var(--bg);
color: var(--text);
border-color: var(--border-strong);
}
/*
---------------------------------------
status toast
---------------------------------------
*/
.status {
position: absolute;
bottom: 70px;
left: 16px;
right: 16px;
padding: 8px 12px;
background: var(--surface-2);
border: 1px solid var(--border-strong);
border-radius: var(--radius-sm);
font-size: 11.5px;
color: var(--text);
text-align: center;
animation: slide-up 0.2s ease;
}
.status.success {
border-color: var(--accent);
color: var(--accent);
}
.status.error {
border-color: var(--danger);
color: var(--danger);
}
@keyframes slide-up {
from { transform: translateY(8px); opacity: 0; }
to { transform: translateY(0); opacity: 1; }
}
/*
---------------------------------------
cookie domain groups
---------------------------------------
*/
.domain-group {
border-bottom: 1px solid var(--border);
}
.domain-header {
display: flex;
align-items: center;
gap: 10px;
padding: 9px 16px;
cursor: pointer;
background: var(--surface);
transition: background 0.1s ease;
}
.domain-header:hover {
background: var(--surface-2);
}
.domain-header.selected {
background: var(--accent-bg);
}
.domain-chevron {
color: var(--text-muted);
transition: transform 0.15s ease;
flex-shrink: 0;
}
.domain-chevron.open {
transform: rotate(90deg);
}
.domain-name {
flex: 1;
font-size: 12.5px;
font-weight: 500;
font-family: ui-monospace, "SF Mono", monospace;
color: var(--text);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.domain-count {
font-size: 10.5px;
color: var(--text-muted);
font-variant-numeric: tabular-nums;
padding: 2px 6px;
background: var(--surface-2);
border-radius: 4px;
}
.cookie-list {
background: var(--bg);
list-style: none;
}
.cookie-item {
display: flex;
align-items: flex-start;
gap: 8px;
padding: 6px 16px 6px 36px;
border-top: 1px solid var(--border);
font-size: 11px;
font-family: ui-monospace, "SF Mono", monospace;
cursor: pointer;
}
.cookie-item:hover {
background: var(--surface);
}
.cookie-name {
color: var(--text);
font-weight: 500;
flex-shrink: 0;
max-width: 40%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.cookie-value {
color: var(--text-muted);
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
min-width: 0;
}
.cookie-flags {
display: flex;
gap: 3px;
flex-shrink: 0;
}
.cookie-flag {
font-size: 8.5px;
padding: 1px 4px;
border-radius: 3px;
background: var(--surface-2);
color: var(--text-muted);
text-transform: uppercase;
letter-spacing: 0.04em;
font-family: system-ui, sans-serif;
font-weight: 600;
}
.cookie-flag.secure {
color: var(--accent);
background: rgba(94, 234, 212, 0.1);
}
.cookie-flag.httponly {
color: #fbbf24;
background: rgba(251, 191, 36, 0.1);
}
/*
---------------------------------------
passphrase modal
---------------------------------------
*/
.modal-backdrop {
position: fixed;
inset: 0;
background: rgba(14, 16, 20, 0.85);
display: flex;
align-items: center;
justify-content: center;
z-index: 100;
animation: fade-in 0.15s ease;
}
@keyframes fade-in {
from { opacity: 0; }
to { opacity: 1; }
}
.modal {
width: 340px;
background: var(--surface);
border: 1px solid var(--border-strong);
border-radius: var(--radius);
overflow: hidden;
animation: slide-up 0.2s ease;
}
.modal-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 14px;
border-bottom: 1px solid var(--border);
}
.modal-header h2 {
font-size: 13px;
font-weight: 600;
}
.modal-body {
padding: 14px;
display: flex;
flex-direction: column;
gap: 10px;
}
.modal-desc {
font-size: 12px;
color: var(--text-dim);
line-height: 1.5;
}
.modal-input {
width: 100%;
padding: 8px 10px;
background: var(--bg);
border: 1px solid var(--border-strong);
border-radius: var(--radius-sm);
color: var(--text);
font-size: 13px;
font-family: ui-monospace, monospace;
outline: none;
transition: border-color 0.15s ease;
}
.modal-input:focus {
border-color: var(--accent);
}
.modal-checkbox {
display: flex;
align-items: center;
gap: 8px;
font-size: 11.5px;
color: var(--text-dim);
cursor: pointer;
user-select: none;
}
.modal-checkbox input {
width: 14px;
height: 14px;
accent-color: var(--accent);
}
.modal-warn {
padding: 8px 10px;
background: rgba(248, 113, 113, 0.08);
border: 1px solid rgba(248, 113, 113, 0.3);
border-radius: var(--radius-sm);
color: var(--danger);
font-size: 11px;
line-height: 1.45;
}
.modal-actions {
display: flex;
gap: 8px;
padding: 12px 14px;
border-top: 1px solid var(--border);
background: var(--bg);
}
.modal-actions .secondary-btn,
.modal-actions .primary-btn {
flex: 1;
}
+140
View File
@@ -0,0 +1,140 @@
<!DOCTYPE html>
<!--
---------------------------------------
portage by pvrz
github: https://github.com/pvrzz/portage
file name: popup.html
---------------------------------------
-->
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="popup.css">
<title>portage</title>
</head>
<body>
<div class="app">
<header class="header">
<div class="header-left">
<div class="logo">
<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M5 12h14M13 5l7 7-7 7"/>
</svg>
</div>
<div class="title-block">
<h1>portage</h1>
<p class="subtitle" id="subtitle">loading...</p>
</div>
</div>
<div class="header-right">
<button class="icon-btn" id="refresh-btn" title="refresh">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M21 12a9 9 0 11-3-6.7L21 8"/>
<path d="M21 3v5h-5"/>
</svg>
</button>
</div>
</header>
<div class="type-tabs">
<button class="type-tab active" data-type="extensions">
<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M20 5h-9.12L10 2H4a2 2 0 00-2 2v16a2 2 0 002 2h16a2 2 0 002-2V7a2 2 0 00-2-2z"/>
</svg>
extensions
</button>
<button class="type-tab" data-type="cookies">
<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M12 2a10 10 0 1010 10 4 4 0 01-5-5 4 4 0 01-5-5"/>
<circle cx="8.5" cy="8.5" r=".5" fill="currentColor"/>
<circle cx="15.5" cy="15.5" r=".5" fill="currentColor"/>
<circle cx="10.5" cy="14.5" r=".5" fill="currentColor"/>
</svg>
cookies
</button>
</div>
<div class="mode-tabs">
<button class="mode-tab active" data-mode="installed">installed</button>
<button class="mode-tab" data-mode="imported">imported</button>
</div>
<div class="selection-bar">
<div class="count">
<span id="selected-count">0</span> selected
</div>
<div class="selection-actions">
<button class="text-btn" id="select-all">all</button>
<button class="text-btn" id="select-none">none</button>
<button class="text-btn" id="select-invert">invert</button>
</div>
</div>
<div class="list-container">
<ul class="ext-list" id="ext-list"></ul>
<div class="empty-state hidden" id="empty-state">
<p id="empty-title">nothing here</p>
<p class="muted" id="empty-sub">import a file or refresh</p>
</div>
</div>
<footer class="footer">
<button class="primary-btn" id="primary-btn" disabled>
<svg id="primary-icon" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M14 3h7v7M10 21H3v-7M21 3l-7 7M3 21l7-7"/>
</svg>
<span id="primary-label">open in tab group</span>
</button>
<div class="secondary-actions">
<button class="secondary-btn" id="export-btn">
<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3"/>
</svg>
export
</button>
<button class="secondary-btn" id="import-btn">
<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M17 8l-5-5-5 5M12 3v12"/>
</svg>
import
</button>
<input type="file" id="import-input" hidden>
</div>
</footer>
<div class="status hidden" id="status"></div>
<div class="modal-backdrop hidden" id="modal-backdrop">
<div class="modal">
<div class="modal-header">
<h2 id="modal-title">passphrase</h2>
<button class="icon-btn" id="modal-close">
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
<path d="M18 6L6 18M6 6l12 12"/>
</svg>
</button>
</div>
<div class="modal-body">
<p class="modal-desc" id="modal-desc">
enter a passphrase to encrypt this file. you'll need it to import.
</p>
<input type="password" class="modal-input" id="modal-passphrase" placeholder="passphrase" autocomplete="off">
<input type="password" class="modal-input hidden" id="modal-passphrase-confirm" placeholder="confirm passphrase" autocomplete="off">
<label class="modal-checkbox hidden" id="modal-skip-encrypt-wrap">
<input type="checkbox" id="modal-skip-encrypt">
<span>skip encryption (export as plain json)</span>
</label>
<div class="modal-warn hidden" id="modal-warn"></div>
</div>
<div class="modal-actions">
<button class="secondary-btn" id="modal-cancel">cancel</button>
<button class="primary-btn" id="modal-confirm">confirm</button>
</div>
</div>
</div>
</div>
<script src="popup.js"></script>
</body>
</html>
+1031
View File
File diff suppressed because it is too large Load Diff