适配v0.26.1

Update endpoints and metadata to match newer memos backend and record new maintainer.

- js/oper.js: switch upload endpoint to api/v1/attachments; replace auth/status POST with auth/me GET and adapt response parsing to response.user.name; stop using user-scoped memo endpoints and use api/v1/memos for tag/search/random requests; fix memo link path to /memos/{uid}.
- manifest.json: bump extension version to 2026.02.22 and update homepage_url to the GitHub repo.
- README.md: add maintainer note, compatibility (v0.26.1) and a collapsible details block.

These changes align the extension with backend API changes and mark the new maintenance status.
This commit is contained in:
jonny
2026-02-22 15:14:48 +08:00
parent c47e0a0b7b
commit dd2609e1e4
3 changed files with 17 additions and 12 deletions
+5
View File
@@ -6,6 +6,10 @@ Chrome 应用商店:<https://chrome.google.com/webstore/detail/memos-bber/cbhj
## 更新日志 ## 更新日志
2026年02月22日 由于原作者基本放弃更新,现接手维护,不兼容更新,匹配 v0.26.1 ,欢迎各位大佬PR
<details>
<summary>点击展开/折叠内容</summary>
2024.07.21 不兼容更新,已匹配 v0.22.3 2024.07.21 不兼容更新,已匹配 v0.22.3
2024.06.15 感谢好心人 [PR#44](https://github.com/lmm214/memos-bber/pull/44) 2024.06.15 感谢好心人 [PR#44](https://github.com/lmm214/memos-bber/pull/44)
@@ -58,3 +62,4 @@ Chrome 应用商店:<https://chrome.google.com/webstore/detail/memos-bber/cbhj
2022.10.24 添加 visiblity 发送设置。 2022.10.24 添加 visiblity 发送设置。
</details>
+9 -9
View File
@@ -181,7 +181,7 @@ function uploadImageNow(base64String, file) {
filename: new_name, filename: new_name,
type: file.type type: file.type
}; };
var upAjaxUrl = info.apiUrl + 'api/v1/resources'; var upAjaxUrl = info.apiUrl + 'api/v1/attachments';
$.ajax({ $.ajax({
url: upAjaxUrl, url: upAjaxUrl,
data: JSON.stringify(data), data: JSON.stringify(data),
@@ -247,8 +247,8 @@ $('#saveKey').click(function () {
const settings = { const settings = {
async: true, async: true,
crossDomain: true, crossDomain: true,
url: apiUrl + 'api/v1/auth/status', url: apiUrl + 'api/v1/auth/me',
method: 'POST', method: 'GET',
headers: { headers: {
'Authorization': 'Bearer ' + apiTokens 'Authorization': 'Bearer ' + apiTokens
} }
@@ -256,9 +256,9 @@ $('#saveKey').click(function () {
$.ajax(settings).done(function (response) { $.ajax(settings).done(function (response) {
// 0.24 版本后无 id 字段,改为从 name 字段获取和判断认证是否成功 // 0.24 版本后无 id 字段,改为从 name 字段获取和判断认证是否成功
if (response && response.name) { if (response && response.user.name) {
// 如果响应包含用户name "users/{id}",存储 apiUrl 和 apiTokens // 如果响应包含用户name "users/{id}",存储 apiUrl 和 apiTokens
var userid = parseInt(response.name.split('/').pop(), 10) var userid = parseInt(response.user.name.split('/').pop(), 10)
chrome.storage.sync.set( chrome.storage.sync.set(
{ {
apiUrl: apiUrl, apiUrl: apiUrl,
@@ -298,7 +298,7 @@ $('#tags').click(function () {
if (info.apiUrl) { if (info.apiUrl) {
var parent = `users/${info.userid}`; var parent = `users/${info.userid}`;
// 从最近的1000条memo中获取tags,因此不保证获取能全部的 // 从最近的1000条memo中获取tags,因此不保证获取能全部的
var tagUrl = info.apiUrl + 'api/v1/' + parent + '/memos?pageSize=1000'; var tagUrl = info.apiUrl + 'api/v1/memos?pageSize=1000';
var tagDom = ""; var tagDom = "";
$.ajax({ $.ajax({
url: tagUrl, url: tagUrl,
@@ -368,7 +368,7 @@ $('#search').click(function () {
var searchDom = "" var searchDom = ""
if(pattern){ if(pattern){
$.ajax({ $.ajax({
url:info.apiUrl+"api/v1/"+parent+"/memos"+filter, url:info.apiUrl+"api/v1/memos"+filter,
type:"GET", type:"GET",
contentType:"application/json", contentType:"application/json",
dataType:"json", dataType:"json",
@@ -429,7 +429,7 @@ $('#random').click(function () {
var filter = "?filter=" + encodeURIComponent(`visibility in ["PUBLIC","PROTECTED"]`); var filter = "?filter=" + encodeURIComponent(`visibility in ["PUBLIC","PROTECTED"]`);
if (info.status) { if (info.status) {
$("#randomlist").html('').hide() $("#randomlist").html('').hide()
var randomUrl = info.apiUrl + "api/v1/" +parent + "/memos" + filter; var randomUrl = info.apiUrl + "api/v1/memos" + filter;
$.ajax({ $.ajax({
url:randomUrl, url:randomUrl,
type:"GET", type:"GET",
@@ -483,7 +483,7 @@ function randDom(randomData){
$(document).on("click","#random-link",function () { $(document).on("click","#random-link",function () {
var memoUid = $("#random-link").data('uid'); var memoUid = $("#random-link").data('uid');
get_info(function (info) { get_info(function (info) {
chrome.tabs.create({url:info.apiUrl+"m/"+memoUid}) chrome.tabs.create({url:info.apiUrl+"memos/"+memoUid})
}) })
}) })
+2 -2
View File
@@ -2,14 +2,14 @@
"manifest_version": 3, "manifest_version": 3,
"name": "__MSG_extName__", "name": "__MSG_extName__",
"default_locale": "en", "default_locale": "en",
"version": "2025.03.29", "version": "2026.02.22",
"action": { "action": {
"default_popup": "popup.html", "default_popup": "popup.html",
"default_icon": "assets/logo_24x24.png", "default_icon": "assets/logo_24x24.png",
"default_title": "__MSG_actionTitle__" "default_title": "__MSG_actionTitle__"
}, },
"description": "__MSG_extDescription__", "description": "__MSG_extDescription__",
"homepage_url": "https://immmmm.com", "homepage_url": "https://github.com/Jonnyan404/memos-bber",
"icons": { "icons": {
"128": "assets/logo.png", "128": "assets/logo.png",
"16": "assets/logo.png", "16": "assets/logo.png",