Skip to content

Commit

Permalink
🎨 The browser extension removes the ending / in URL siyuan-note/siy…
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed May 20, 2024
1 parent 4b8508f commit a01c1c8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ document.addEventListener('DOMContentLoaded', () => {
const showTipElement = document.getElementById('showTip')
const notebooksElement = document.getElementById('notebooks')
ipElement.addEventListener('change', () => {
let ip = ipElement.value;
// 去掉结尾的斜杆 https://github.com/siyuan-note/siyuan/issues/11478
for (let i = ip.length - 1; i >= 0; i--) {
if ('/' === ip[i]) {
ip = ip.substring(0, i)
} else {
break
}
}
ipElement.value = ip

chrome.storage.sync.set({
ip: ipElement.value,
})
Expand Down

0 comments on commit a01c1c8

Please sign in to comment.