-
Notifications
You must be signed in to change notification settings - Fork 1
利用規約・プライバシーポリシーの追加、独自に利用状況を収集する処理を追加 #97
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,3 +16,6 @@ node_modules | |
|
|
||
| # Parcel build cache | ||
| .parcel-cache/ | ||
|
|
||
| # dotenv | ||
| .env | ||
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 |
|---|---|---|
|
|
@@ -44,12 +44,37 @@ export const startElmApp = (mainModule) => { | |
| app.ports.sendAnalyticsEvent.subscribe((event) => { | ||
| const { category, action, label, value, ...others } = JSON.parse(event); | ||
| console.debug({ category, action, label, value, others }); | ||
| if (gtag) { | ||
| if (gtag) { // Google Analytics | ||
| const data = Object.assign({ | ||
| "event_category": category, | ||
| "event_label": label | ||
| }, value ? { value } : {}); | ||
| gtag("event", action, Object.assign({}, data, others)); | ||
| } | ||
|
|
||
| // Send timer settings to my analytics on timer start. | ||
| if (`${import.meta.env.VITE_SURVEY_URL}` !== "" && action === "sync_timer_start") { | ||
| const params = new URLSearchParams({ | ||
| host: document.location.host, | ||
| fg: others.setting_fgColor || "", | ||
| bg: others.setting_bgColor || "", | ||
| ff: others.setting_fgFont || "", | ||
| init: others.setting_initial || "", | ||
| h: others.setting_show_hours || "", | ||
| p: others.setting_show_progress || "", | ||
| }); | ||
|
|
||
| fetch(`${import.meta.env.VITE_SURVEY_URL}?${params.toString()}`).then((res) => { | ||
| if (res.ok) { | ||
| console.debug("Survey request sent."); | ||
| } else { | ||
| console.log("Survey request failed."); | ||
| } | ||
| }).catch((err) => { | ||
| console.log("Survey request failed.", err); | ||
| }) | ||
| } | ||
|
Comment on lines
+67
to
+76
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Improve error handling and URL validation Several issues need attention:
+ const surveyUrl = import.meta.env.VITE_SURVEY_URL;
+ if (!surveyUrl || !surveyUrl.startsWith('https://')) {
+ console.error('Invalid survey URL configuration');
+ return;
+ }
- fetch(`${import.meta.env.VITE_SURVEY_URL}?${params.toString()}`).then((res) => {
+ fetch(`${surveyUrl}?${params.toString()}`).then((res) => {
if (res.ok) {
- console.debug("Survey request sent.");
+ // Success case - consider adding metrics instead of console logs
} else {
- console.log("Survey request failed.");
+ // Use proper error tracking service
+ throw new Error(`Survey request failed: ${res.status}`);
}
}).catch((err) => {
- console.log("Survey request failed.", err);
+ // Use proper error tracking service
+ reportError('Survey request failed', err);
}) |
||
| }); | ||
|
|
||
|
|
||
| } | ||
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.
Add user consent mechanism for data collection
The code collects user settings and host information without explicit user consent, which may violate privacy regulations (GDPR, CCPA).
Consider implementing: