-
-
Notifications
You must be signed in to change notification settings - Fork 514
fix(rhwp-chrome): 썸네일 로딩 스피너 정리 + options CSP 호환 #167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev
Previous commit
fix(rhwp-chrome): options 페이지 CSP 호환
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Loading branch information
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| // i18n 적용 | ||
| document.getElementById('title').textContent = chrome.i18n.getMessage('optionsTitle'); | ||
| document.getElementById('labelAutoOpen').textContent = chrome.i18n.getMessage('optionsAutoOpen'); | ||
| document.getElementById('labelShowBadges').textContent = chrome.i18n.getMessage('optionsShowBadges'); | ||
| document.getElementById('labelHoverPreview').textContent = chrome.i18n.getMessage('optionsHoverPreview'); | ||
| document.getElementById('saved').textContent = chrome.i18n.getMessage('optionsSaved'); | ||
| document.getElementById('privacy').textContent = chrome.i18n.getMessage('optionsPrivacy'); | ||
|
|
||
| const inputs = ['autoOpen', 'showBadges', 'hoverPreview']; | ||
|
|
||
| // 설정 로드 | ||
| chrome.storage.sync.get( | ||
| { autoOpen: true, showBadges: true, hoverPreview: true }, | ||
| (settings) => { | ||
| for (const id of inputs) { | ||
| document.getElementById(id).checked = settings[id]; | ||
| } | ||
| } | ||
| ); | ||
|
|
||
| // 설정 저장 | ||
| for (const id of inputs) { | ||
| document.getElementById(id).addEventListener('change', () => { | ||
| const settings = {}; | ||
| for (const id2 of inputs) { | ||
| settings[id2] = document.getElementById(id2).checked; | ||
| } | ||
| chrome.storage.sync.set(settings, () => { | ||
| const saved = document.getElementById('saved'); | ||
| saved.classList.add('show'); | ||
| setTimeout(() => saved.classList.remove('show'), 1500); | ||
| }); | ||
| }); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
options.js가 전역 스코프에서 실행되어
inputs등이 options 페이지 전역에 노출됩니다. 이 레포의 다른 non-module 스크립트(content-script.js, dev-tools-inject.js)는 IIFE +'use strict'로 감싸 전역 오염을 방지하고 있어 동일 패턴을 적용하는 게 안전합니다.