不知道现在还有多少人还在用 1Password 6。
先感谢下 22 年这个帖子里的大神,当年靠它解决了 Chrome 99 下 Classic 扩展不能用的问题:
https://www.v2ex.com/t/856341
结果最近 Chrome 又开始彻底淘汰 Manifest V2,一开始还能开 flag ,用着用着就得靠命令行参数启动才能加载 MV2 插件,Classic 扩展眼看也要彻底凉了。
不太想迁移订阅版,就自己动手把 1Password Classic 扩展改成了 Manifest V3,算是又能再坚持一阵。
代码在这:
https://github.com/wowh/1password
我是基于之前老外分享的插件备份改的,介意的话可以自己审查下代码。
用法很简单:
我这边简单用下来是 OK 的。
如果你用的时候遇到什么 Bug ,可以在扩展的视图里看下 log,贴出来我帮你一起看看。
1
Q980q48Jgj6pRXoO PRO 不错
|
2
nifan 3 天前
|
4
steveshi 3 天前
1p 6 如果不是太老了 Intel Only 确实可以继续用下去
|
5
hackpro 2 天前
我用 Gemini 把 https://github.com/wowh/1password
和之前的代码 https://github.com/scramblr/1password 做了比对 大家可以参考一下 While they are both versions of the Stanford JavaScript Crypto Library (SJCL) and share about 99% of the same logic, Code 2 contains environment-safety modifications that are missing in Code 1. Specifically, Code 2 has been updated to be more "environment-aware" (likely to prevent crashes in Node.js or Server-Side Rendering environments), whereas Code 1 is a more traditional browser-only minification. Key Logical Differences Here are the specific areas where the logic differs beyond simple formatting: 1. Environment Safety Checks (window and document) In the sjcl.random.startCollectors and stopCollectors functions, Code 2 adds checks to see if window or document are defined before accessing them. Code 1: JavaScript if(window.addEventListener){ ... } else if(document.attachEvent){ ... } Logic: This will throw a ReferenceError in environments like Node.js because window is not defined. Code 2: JavaScript if (typeof window !== "undefined" && window.addEventListener) { ... } else if (typeof document !== "undefined" && document.attachEvent) { ... } Logic: This is safe. It checks the type first, so it won't crash in non-browser environments. 2. Error Handling Removal In the startCollectors function, Code 1 has a fallback error that Code 2 has removed. Code 1: JavaScript else throw new sjcl.exception.bug("can't attach event"); Code 2: The else block is entirely removed. If it can't find window or document, it simply does nothing rather than throwing an exception. 3. Stop Collectors Logic A similar change exists in stopCollectors: Code 1: Directly checks window.removeEventListener. Code 2: Checks typeof window !== "undefined" before attempting to access window.removeEventListener. While they share the same core cryptographic libraries (SJCL) and general business logic, Code 2 is a significantly modified version of Code 1, specifically updated to be compatible with Chrome Extension Manifest V3 (MV3). Code 1 is written for the older Manifest V2 (MV2) standard. Here are the specific logical and functional differences: 1. Global Scope Reference (window vs. self) Since Manifest V3 uses Service Workers (which do not have access to the window object), the global scope references have been changed. Code 1: Uses window (e.g., n='undefined'!=typeof window&&window===this?this... and window.OnePassword=r). Code 2: Uses self or globalThis (e.g., n = 'undefined' != typeof self && self.self === self ? self... and self.OnePassword = r). 2. Browser Action API Chrome changed the "Browser Action" API to a generic "Action" API in Manifest V3. Code 1: Uses chrome.browserAction (e.g., chrome.browserAction.onClicked... and chrome.browserAction.enable()). Code 2: Uses chrome.action (e.g., chrome.action.onClicked... and chrome.action.enable()). 3. Navigation Interception (webRequest vs. tabs) This is the most significant logical rewrite. Manifest V3 restricts the use of blocking webRequest. Code 1: Uses chrome.webRequest.onBeforeRequest with the ['blocking'] attribute to intercept URLs containing onepasswdfill. Code 2: Completely removes the webRequest logic and replaces it with a chrome.tabs.onUpdated listener. It now watches for tab updates to detect those specific URLs instead of intercepting the network request. 4. Context Menus Implementation Code 1: Uses the onclick property directly inside the chrome.contextMenus.create object. Code 2: Removes the onclick property from the creation object (as it's forbidden in MV3) and implements a centralized listener using chrome.contextMenus.onClicked.addListener. It also adds a mandatory id to the menu item. 5. URL API Modernization Code 1: Accesses the URL constructor via window.URL || window.webkitURL. Code 2: Accesses it via globalThis.URL || URL. |
6
hackpro 2 天前
和官网原始版本( 6.8.9 )最大的不同就是现在完全不需要输入 master 密码解锁
Alfred launch 后直接就解锁了🔓 不知道有其他大佬也是这样的情况吗😄😄 |
14
hackpro 9 小时 32 分钟前
@wowh
* macOS 15.1 light theme, 1p 6.8.9 主程序 light theme, 1p mini extension dark * macOS 10.15 light theme, 1p 6.8.9 主程序 light theme, 1p mini extension light https://imgur.com/a/zhTyhfe |