Skip to content

Commit

Permalink
Merge pull request #5 from k-miyata/change-selector-and-path
Browse files Browse the repository at this point in the history
Change query selector and path pattern
  • Loading branch information
k-miyata authored Apr 20, 2019
2 parents b124ed8 + 2cbc369 commit 8d025f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
function changeBackground() {
document
.querySelector('body.ns-note main:not([hidden])')
.querySelector('main.p-article:not([hidden])')
.classList.add('notemu-chromeext', 'enhanced-background');
}

function isArticlePage() {
const path = location.pathname;
// "https://note.mu/<Username>/n/<Note ID>" or "https://<Domain>/n/<Note ID>"
return /^\/[\w\-]+\/n\/\w+$/.test(path) || /^\/n\/\w+$/.test(path);
return /^\/[\w\-]+\/n\/n[a-z0-9]{12}$/.test(path) || /^\/n\/n[a-z0-9]{12}$/.test(path);
}

document.body.addEventListener('transitionend', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "__MSG_ext_name__",
"description": "__MSG_ext_description__",
"version": "1.0.3",
"version": "1.0.4",
"icons": {
"128": "icon_128.png"
},
Expand Down

0 comments on commit 8d025f8

Please sign in to comment.