Skip to content

Commit

Permalink
Merge pull request #21 from 2jun0/dev
Browse files Browse the repository at this point in the history
Update 1.5.8
  • Loading branch information
2jun0 authored Feb 21, 2023
2 parents 0a8f49c + dcb3c06 commit 2cc9d1b
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 34 deletions.
30 changes: 22 additions & 8 deletions manifest/chrome.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@
},
"web_accessible_resources": [
{
"resources": ["*.js"],
"matches": ["<all_urls>"]
"resources": [
"*.js"
],
"matches": [
"<all_urls>"
]
}
],
"background": {
Expand All @@ -29,14 +33,24 @@
},
"content_scripts": [
{
"matches": ["*://*.youtube.com/*"],
"js": ["js/content_script_loader.js"],
"css": ["css/content_script.css"],
"matches": [
"*://*.youtube.com/*"
],
"js": [
"js/content_script_loader.js"
],
"css": [
"css/content_script.css"
],
"run_at": "document_end",
"all_frames": false
}
],
"permissions": ["storage"],
"host_permissions": ["*://*.youtube.com/*"],
"permissions": [
"storage"
],
"host_permissions": [
"*://*.youtube.com/*"
],
"minimum_chrome_version": "92"
}
}
31 changes: 23 additions & 8 deletions manifest/firefox.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@
},
"web_accessible_resources": [
{
"resources": ["*.js"],
"matches": ["<all_urls>"]
"resources": [
"*.js"
],
"matches": [
"<all_urls>"
]
}
],
"background": {
Expand All @@ -29,13 +33,24 @@
},
"content_scripts": [
{
"matches": ["*://*.youtube.com/*"],
"js": ["js/content_script_loader.js"],
"css": ["css/content_script.css"],
"matches": [
"*://*.youtube.com/*"
],
"js": [
"js/content_script_loader.js"
],
"css": [
"css/content_script.css"
],
"run_at": "document_end",
"all_frames": false
}
],
"permissions": ["storage", "tabs"],
"host_permissions": ["*://*.youtube.com/*"]
}
"permissions": [
"storage",
"tabs"
],
"host_permissions": [
"*://*.youtube.com/*"
]
}
2 changes: 1 addition & 1 deletion src/css/content_script.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#cc-status {
padding: 3px 4px;
border-radius: 2px;
border-radius: 4px;
font-weight: 500;
}

Expand Down
34 changes: 17 additions & 17 deletions src/js/content/model/CcTagModel.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,21 @@ describe('CcTagModel', () => {
})
})

describe('hasCaptions should return correct value', () => {
it('https://youtu.be/jNQXAC9IVRw has en caption', async () => {
const result = await ccTagModel.hasCaptions(
'https://youtu.be/jNQXAC9IVRw',
['en'],
)
expect(result).toBe(true)
})

it("https://youtu.be/jNQXAC9IVRw doesn' have ko caption", async () => {
const result = await ccTagModel.hasCaptions(
'https://youtu.be/jNQXAC9IVRw',
['ko'],
)
expect(result).toBe(false)
})
})
// describe('hasCaptions should return correct value', () => {
// it('https://www.youtube.com/watch?v=cXCBiF67jLM has en caption', async () => {
// const result = await ccTagModel.hasCaptions(
// 'https://www.youtube.com/watch?v=cXCBiF67jLM',
// ['en'],
// )
// expect(result).toBe(true)
// })

// it("https://youtu.be/jNQXAC9IVRw doesn' have ko caption", async () => {
// const result = await ccTagModel.hasCaptions(
// 'https://youtu.be/jNQXAC9IVRw',
// ['ko'],
// )
// expect(result).toBe(false)
// })
// })
})

0 comments on commit 2cc9d1b

Please sign in to comment.