diff --git a/README.md b/README.md index 7fab864..fffbbc7 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # easyOA -每天阅读论文,经常各种pdf链接满天飞,很头疼,根据自己的需求,编写了 easyOA 插件,它可以: -1. PDF页面重命名为论文标题,方便标签页管理和搜索; +每天阅读论文,经常各种pdf链接满天飞,很头疼。根据自己的需求,编写了 `easyOA` 插件,它可以: +1. PDF页面重命名为论文标题,方便标签页管理和搜索,让你的历史记录和 [OneTab](https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall) 页面更清爽; 2. 单击图标返回摘要页,摆脱手动修改URL。 Reading papers every day, I often receive various PDF links, which can be quite overwhelming. To meet my own needs, I developed the `easyOA` plugin, which can: -1. Rename PDF pages with the paper title for easier tab management and searching. +1. Rename PDF pages with the paper title for easier tab management and searching, make your browser history and [OneTab](https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall) page clean. 2. Return to the abstract page with a single click on the icon, eliminating the need for manually modifying the URL. @@ -18,18 +18,21 @@ Reading papers every day, I often receive various PDF links, which can be quite - papers.nips.cc -可能开发的功能 / Possible future developments: +可能的开发计划 / Possible future developments: 1. Download PDF with custom filename in the abstract page. 2. link arxiv for abstract pages on ojs.aaai.org. +3. Edge & Firefox. ## 安装 / Install -之后会上传到 Chrome 应用商店,现在可以下载或克隆到本地,以开发者模式手动安装,参见 [How to install the unpacked extension in Chrome](https://webkul.com/blog/how-to-install-the-unpacked-extension-in-chrome/) (安装时选择本项目下的 `./chrome` 文件夹). +Chrome 应用商店正在审核中,现在可以在 [release](https://github.com/izhx/easy-oa/releases) 页面下载 `crx文件` 手动安装。 +> 如果要 debug 或者贡献代码,可以下载或克隆到本地,以开发者模式手动安装,参见 [How to install the unpacked extension in Chrome](https://webkul.com/blog/how-to-install-the-unpacked-extension-in-chrome/) (安装时选择本项目下的 `./chrome` 文件夹). -I am currently trying to upload it to the Chrome Web Store. -For now, you can clone it to your local machine and install it in developer mode. +Under Chrome app store reviewing, and now you can download `crx file` from the [release](https://github.com/izhx/easy-oa/releases) page and install manually. + +> For debugging or contributing, you can clone it to your local machine and install it in developer mode. Refer to [How to install the unpacked extension in Chrome](https://webkul.com/blog/how-to-install-the-unpacked-extension-in-chrome/) (select the `./chrome` folder of this repo). diff --git a/chrome/background.js b/chrome/background.js index 2e36994..a3ed8e8 100644 --- a/chrome/background.js +++ b/chrome/background.js @@ -1,6 +1,5 @@ // Add the back to abstract button. -const arxivIdRegex = /\/(\d{4}\.\d{4,5})/; const mlrPressRegex = /\/[^\/]+$/; let tabTitles = {}; @@ -66,7 +65,7 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { // Remove the saved title when the tab is closed. chrome.tabs.onRemoved.addListener((tabId, removeInfo) => { - delete tabTitles[tabId]; + if (isPdf(tab.url)) delete tabTitles[tabId]; }); diff --git a/chrome/manifest.json b/chrome/manifest.json index 7962384..463ed6c 100644 --- a/chrome/manifest.json +++ b/chrome/manifest.json @@ -1,13 +1,23 @@ { - "name": "easyOA", - "description": "1. PDF back to abstract page; 2. Rename PDF page title;", + "name": "EasyOA", + "description": "1. PDF back to abstract page; 2. Rename PDF page with paper title;", "version": "0.1", "manifest_version": 3, "background": { "service_worker": "background.js" }, "action": { - "default_title": "Click to abstract!" + "default_title": "Click to abstract!", + "icons": { + "16": "assets/easyoa-16.png", + "48": "assets/easyoa-48.png", + "128": "assets/easyoa-128.png" + } + }, + "icons": { + "16": "assets/easyoa-16.png", + "48": "assets/easyoa-48.png", + "128": "assets/easyoa-128.png" }, "content_scripts": [ { diff --git a/resources/assets/easyoa-128.png b/resources/assets/easyoa-128.png new file mode 100644 index 0000000..fdcbe65 Binary files /dev/null and b/resources/assets/easyoa-128.png differ diff --git a/resources/assets/easyoa-16.png b/resources/assets/easyoa-16.png new file mode 100644 index 0000000..16ea28c Binary files /dev/null and b/resources/assets/easyoa-16.png differ diff --git a/resources/assets/easyoa-48.png b/resources/assets/easyoa-48.png new file mode 100644 index 0000000..808bbaa Binary files /dev/null and b/resources/assets/easyoa-48.png differ