<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Peersky | UCSC OSPO</title><link>https://deploy-preview-1007--ucsc-ospo.netlify.app/tag/peersky/</link><atom:link href="https://deploy-preview-1007--ucsc-ospo.netlify.app/tag/peersky/index.xml" rel="self" type="application/rss+xml"/><description>Peersky</description><generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><lastBuildDate>Tue, 23 Sep 2025 00:00:00 +0000</lastBuildDate><image><url>https://deploy-preview-1007--ucsc-ospo.netlify.app/media/logo_hub6795c39d7c5d58c9535d13299c9651f_74810_300x300_fit_lanczos_3.png</url><title>Peersky</title><link>https://deploy-preview-1007--ucsc-ospo.netlify.app/tag/peersky/</link></image><item><title>[Final] Building PeerSky’s Extensions System</title><link>https://deploy-preview-1007--ucsc-ospo.netlify.app/report/osre25/ucsc/peersky/2025-09-22-6cobi/</link><pubDate>Tue, 23 Sep 2025 00:00:00 +0000</pubDate><guid>https://deploy-preview-1007--ucsc-ospo.netlify.app/report/osre25/ucsc/peersky/2025-09-22-6cobi/</guid><description>&lt;p>Hi everyone, I’m Hanzhong Liu. Over the summer I worked on building the &lt;code>peersky://extensions&lt;/code> system for &lt;a href="https://github.com/p2plabsxyz/peersky-browser" target="_blank" rel="noopener">PeerSky browser&lt;/a>, a decentralized and privacy-first browser built on Electron.&lt;/p>
&lt;p>This post is my final GSoC 2025 update — covering how the extensions manager was designed, the security model behind IPC, the UI for managing extensions, and what’s next for PeerSky.&lt;/p>
&lt;h2 id="project-overview">Project Overview&lt;/h2>
&lt;p>The new extensions system makes PeerSky behave like a modern browser: you can install extensions from the Chrome Web Store or from local files, enable/disable them, update or uninstall, and interact with their toolbar actions through a puzzle-menu UI.&lt;/p>
&lt;h3 id="key-design-goals">Key Design Goals&lt;/h3>
&lt;ul>
&lt;li>Secure preload-based API exposure via &lt;code>contextBridge&lt;/code>&lt;/li>
&lt;li>Support for preinstalled, Web Store, and local packages&lt;/li>
&lt;li>Toolbar integration with pin/unpin support (up to six)&lt;/li>
&lt;li>Robust validation: MV3-only, size caps, zip-slip prevention&lt;/li>
&lt;/ul>
&lt;p>
&lt;figure >
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img src="./peersky-extensions-management.png" alt="Extensions Management" loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;/p>
&lt;h2 id="highlights">Highlights&lt;/h2>
&lt;h3 id="preinstalled-mv3s">Preinstalled MV3s&lt;/h3>
&lt;p>PeerSky now ships with three trusted extensions out of the box:&lt;/p>
&lt;ul>
&lt;li>Dark Reader&lt;/li>
&lt;li>Linguist (web page translator)&lt;/li>
&lt;li>uBlock Origin Lite&lt;/li>
&lt;/ul>
&lt;p>They remain installed by default but can be disabled at any time. This ensures users always have a working baseline without needing to browse an extension store.&lt;/p>
&lt;h3 id="electron-integration">Electron Integration&lt;/h3>
&lt;p>Instead of injecting scripts, the system uses &lt;strong>preload + IPC&lt;/strong>. Each operation is routed through validated IPC channels:&lt;/p>
&lt;ul>
&lt;li>&lt;code>listExtensions&lt;/code>, &lt;code>installFromWebStore&lt;/code>, &lt;code>toggleExtension&lt;/code>, etc.&lt;/li>
&lt;li>All methods are scoped to &lt;code>peersky://extensions&lt;/code> only.&lt;/li>
&lt;li>Rate limiting and size caps are enforced per renderer.&lt;/li>
&lt;/ul>
&lt;p>This design makes the surface auditable and prevents privilege leaks.&lt;/p>
&lt;h3 id="toolbar--puzzle-menu">Toolbar &amp;amp; Puzzle Menu&lt;/h3>
&lt;p>Browser actions appear in a puzzle menu and can be pinned for quick access:&lt;/p>
&lt;ul>
&lt;li>Up to six pins are allowed&lt;/li>
&lt;li>Pinned state persists across sessions.&lt;/li>
&lt;li>Popups (e.g., for translators or wallets) open in isolated windows, with OAuth flows preserved via popup guards.&lt;/li>
&lt;/ul>
&lt;h3 id="security-highlights">Security Highlights&lt;/h3>
&lt;ul>
&lt;li>Installs capped at &lt;strong>60 MB&lt;/strong>, with early rejection on oversized payloads&lt;/li>
&lt;li>&lt;strong>5 installs/minute&lt;/strong> per renderer to prevent abuse&lt;/li>
&lt;li>ZIP/CRX extraction hardened against path traversal&lt;/li>
&lt;li>MV3 required; permissions validated at install with warnings for risky hosts&lt;/li>
&lt;li>Web Store installs use Google-signed CRX verification via &lt;code>electron-chrome-web-store&lt;/code>&lt;/li>
&lt;/ul>
&lt;h2 id="example-installing-from-the-web-store">Example: Installing from the Web Store&lt;/h2>
&lt;p>Adding a new extension is simple:&lt;/p>
&lt;ol>
&lt;li>Paste a Chrome Web Store URL or ID into the install bar.&lt;/li>
&lt;li>PeerSky downloads and validates the CRX.&lt;/li>
&lt;li>On success, the extension appears in the grid with toggle, update, and remove options.&lt;/li>
&lt;/ol>
&lt;h2 id="reflection">Reflection&lt;/h2>
&lt;p>This project was both challenging and rewarding. Designing an extension system meant grappling with security, IPC design, and user experience at the same time. I learned to think carefully about security management, UI/UX positioning, and design APIs that are auditable.&lt;/p>
&lt;p>I’m grateful to my mentor Akhilesh Thite and the UC OSPO team for their guidance and feedback. Their support pushed me to make deliberate technical decisions and communicate them clearly.&lt;/p>
&lt;p>You can explore the project here:
&lt;a href="https://github.com/p2plabsxyz/peersky-browser" target="_blank" rel="noopener">https://github.com/p2plabsxyz/peersky-browser&lt;/a>&lt;/p></description></item><item><title>[MidTerm] Building PeerSky’s Settings System</title><link>https://deploy-preview-1007--ucsc-ospo.netlify.app/report/osre25/ucsc/peersky/2025-07-24-6cobi/</link><pubDate>Thu, 24 Jul 2025 00:00:00 +0000</pubDate><guid>https://deploy-preview-1007--ucsc-ospo.netlify.app/report/osre25/ucsc/peersky/2025-07-24-6cobi/</guid><description>&lt;p>Hi everyone, I’m Hanzhong Liu. My project focuses on building a secure and extensible &lt;code>peersky://settings&lt;/code> system for the &lt;a href="https://github.com/p2plabsxyz/peersky-browser" target="_blank" rel="noopener">PeerSky browser&lt;/a>, a decentralized and privacy-first browser built on Electron.&lt;/p>
&lt;p>This post is a midterm check-in covering what’s been implemented so far — from IPC architecture to real-time theme and wallpaper updates — and a preview of what’s coming next.&lt;/p>
&lt;h2 id="project-overview">Project Overview&lt;/h2>
&lt;p>Peersky’s new settings system is designed to unify browser preferences (themes, search engine, appearance, extensions, etc.) into a single modular interface. It’s accessible via a protocol route (&lt;code>peersky://settings&lt;/code>) and built using web-standard HTML/CSS, scoped APIs, and Electron’s context isolation model.&lt;/p>
&lt;h3 id="key-design-goals">Key Design Goals:&lt;/h3>
&lt;ul>
&lt;li>Secure preload-based API exposure via &lt;code>contextBridge&lt;/code>&lt;/li>
&lt;li>Fast access to user preferences with zero-flicker wallpaper updates&lt;/li>
&lt;li>Extensibility for bookmarks, future plugins, and privacy tools&lt;/li>
&lt;/ul>
&lt;h2 id="midterm-progress-highlights">Midterm Progress Highlights&lt;/h2>
&lt;h3 id="electron-integration">Electron Integration&lt;/h3>
&lt;p>Rather than using &lt;code>webFrame.executeJavaScript()&lt;/code>, I implemented preload-scoped APIs using &lt;code>contextBridge&lt;/code> and &lt;code>ipcRenderer&lt;/code> to prevent injection vulnerabilities and ensure synchronous availability during early page load. Each internal protocol (settings, home, bookmarks) is granted its own API access level.&lt;/p>
&lt;blockquote>
&lt;p>Code: &lt;a href="https://github.com/p2plabsxyz/peersky-browser/blob/main/src/pages/unified-preload.js" target="_blank" rel="noopener">&lt;code>src/pages/unified-preload.js&lt;/code>&lt;/a>&lt;/p>
&lt;/blockquote>
&lt;h3 id="modular-settings-page">Modular Settings Page&lt;/h3>
&lt;p>The UI lives in a single HTML file with sidebar-based navigation (Appearance, Search, Bookmarks, Extensions). Each section updates independently using event-driven IPC and live sync.&lt;/p>
&lt;h3 id="wallpaper--theme-switching">Wallpaper &amp;amp; Theme Switching&lt;/h3>
&lt;ul>
&lt;li>Supports both built-in wallpapers and custom uploads&lt;/li>
&lt;li>Background applies instantly using &lt;code>sendSync()&lt;/code> during preload&lt;/li>
&lt;li>Themes (light, dark, system) are controlled using root-level CSS variables and real-time IPC events&lt;/li>
&lt;/ul>
&lt;p>
&lt;figure >
&lt;div class="d-flex justify-content-center">
&lt;div class="w-100" >&lt;img src="https://hackmd.io/_uploads/S11q7M1Dee.png" alt="Wallpaper" loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;/p>
&lt;h3 id="cache--search-engine">Cache &amp;amp; Search Engine&lt;/h3>
&lt;ul>
&lt;li>Added IPC handler to clear both Electron session and P2P cache directories (&lt;code>ipfs/&lt;/code>, &lt;code>hyper/&lt;/code>)&lt;/li>
&lt;li>Settings API allows switching between DuckDuckGo, Ecosia, and Startpage via dropdown&lt;/li>
&lt;/ul>
&lt;h3 id="example-adding-a-new-setting-autosave">Example: Adding a New Setting (&lt;code>autoSave&lt;/code>)&lt;/h3>
&lt;p>I also documented how developers can add new settings like &lt;code>autoSave&lt;/code> using:&lt;/p>
&lt;ul>
&lt;li>&lt;code>settings-manager.js&lt;/code> for default values and validation&lt;/li>
&lt;li>Preload event listeners (&lt;code>onAutoSaveChanged&lt;/code>)&lt;/li>
&lt;li>UI toggles and save logic in &lt;code>settings.js&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>Documentation link: &lt;a href="https://github.com/p2plabsxyz/peersky-browser/blob/main/docs/settings.md" target="_blank" rel="noopener">Settings Guide&lt;/a>&lt;/p>
&lt;h2 id="reflection">Reflection&lt;/h2>
&lt;p>I’m really thankful for the mentorship I’ve received from Akhilesh Thite. His guidance has been the perfect balance of autonomy and support. He challenged me to reason clearly about technical choices, especially when I thought some of them are minor and not worthing paying attention to. His feedback helped me write cleaner, better-scoped code. This project has helped me grow as a software engineer in ways I didn’t fully anticipate, but I&amp;rsquo;ve enjoyed it so so much.&lt;/p>
&lt;p>You can explore the project here:&lt;br>
&lt;a href="https://github.com/p2plabsxyz/peersky-browser" target="_blank" rel="noopener">https://github.com/p2plabsxyz/peersky-browser&lt;/a>&lt;/p></description></item></channel></rss>