mirror of
https://github.com/MichMich/MagicMirror.git
synced 2026-05-24 13:13:35 +00:00
I was playing around with the newsfeed notification system (`ARTICLE_MORE_DETAILS`, `ARTICLE_TOGGLE_FULL`, …) and discovered some issues with the full article view: The iframe was loading the CORS proxy URL instead of the actual article URL, which could cause blank screens depending on the feed. Also, many news sites block iframes entirely (`X-Frame-Options: DENY`) and the user got no feedback at all — just an empty page. On top of that, scrolling used `window.scrollTo()` which moved the entire MagicMirror page instead of just the article. This PR cleans that up: - Use the raw article URL for the iframe (CORS proxy is only needed for server-side feed fetching) - Check `X-Frame-Options` / `Content-Security-Policy` headers server-side before showing the iframe — if the site blocks it, show a brief "Article cannot be displayed here." message and return to normal view - Show the iframe as a fixed full-screen overlay so other modules aren't affected, scroll via `container.scrollTop` - Keep the progressive disclosure behavior for `ARTICLE_MORE_DETAILS` (title → description → iframe → scroll) - Delete `fullarticle.njk`, replace with `getDom()` override - Fix `ARTICLE_INFO_RESPONSE` returning proxy URL instead of real URL - A few smaller fixes (negative scroll, null guard) - Add `NEWSFEED_ARTICLE_UNAVAILABLE` translation to all 47 language files - Add e2e tests for the notification handlers (`ARTICLE_NEXT`, `ARTICLE_PREVIOUS`, `ARTICLE_INFO_REQUEST`, `ARTICLE_LESS_DETAILS`) ## What this means for users - The full article view now works reliably across different feeds - If a news site blocks iframes, the user sees a brief message instead of a blank screen - Additional e2e tests make the module more robust and less likely to break silently in future MagicMirror versions
55 lines
1.9 KiB
JSON
55 lines
1.9 KiB
JSON
{
|
|
"LOADING": "正在載入 …",
|
|
|
|
"DAYBEFOREYESTERDAY": "前天",
|
|
"YESTERDAY": "昨天",
|
|
"TODAY": "今天",
|
|
"TOMORROW": "明天",
|
|
"DAYAFTERTOMORROW": "後天",
|
|
"RUNNING": "結束日期",
|
|
"EMPTY": "沒有更多的活動。",
|
|
"WEEK": "第 {weekNumber} 週",
|
|
|
|
"N": "北風",
|
|
"NNE": "北偏東風",
|
|
"NE": "東北風",
|
|
"ENE": "東偏北風",
|
|
"E": "東風",
|
|
"ESE": "東偏南風",
|
|
"SE": "東南風",
|
|
"SSE": "南偏東風",
|
|
"S": "南風",
|
|
"SSW": "南偏西風",
|
|
"SW": "西南風",
|
|
"WSW": "西偏南風",
|
|
"W": "西風",
|
|
"WNW": "西偏北風",
|
|
"NW": "西北風",
|
|
"NNW": "北偏西風",
|
|
|
|
"FEELS": "體感溫度 {DEGREE}",
|
|
"PRECIP_POP": "降雨機率",
|
|
"PRECIP_AMOUNT": "降雨量",
|
|
|
|
"MODULE_CONFIG_CHANGED": "模組 {MODULE_NAME} 的設定檔選項已更改。\n請參見說明文件。",
|
|
"MODULE_CONFIG_ERROR": "{MODULE_NAME} 模組發生錯誤。{ERROR}",
|
|
"MODULE_ERROR_MALFORMED_URL": "網址格式錯誤。",
|
|
"MODULE_ERROR_NO_CONNECTION": "無網路連線。",
|
|
"MODULE_ERROR_UNAUTHORIZED": "授權失敗。",
|
|
"MODULE_ERROR_RATE_LIMITED": "請求過多。稍後重試。",
|
|
"MODULE_ERROR_SERVER_ERROR": "伺服器錯誤。稍後重試。",
|
|
"MODULE_ERROR_CLIENT_ERROR": "請求失敗。",
|
|
"MODULE_ERROR_UNSPECIFIED": "查看日誌以了解詳情。",
|
|
|
|
"NEWSFEED_NO_ITEMS": "目前沒有新聞。",
|
|
"NEWSFEED_ARTICLE_UNAVAILABLE": "文章無法在此處顯示。",
|
|
|
|
"UPDATE_NOTIFICATION": "MagicMirror² 有可用更新。",
|
|
"UPDATE_NOTIFICATION_MODULE": "{MODULE_NAME} 模組有可用更新。",
|
|
"UPDATE_INFO_SINGLE": "目前版本在 {BRANCH_NAME} 分支上已落後了 {COMMIT_COUNT} 次 commit。",
|
|
"UPDATE_INFO_MULTIPLE": "目前版本在 {BRANCH_NAME} 分支上已落後了 {COMMIT_COUNT} 次 commit。",
|
|
"UPDATE_NOTIFICATION_DONE": "{MODULE_NAME} 模組更新完成。",
|
|
"UPDATE_NOTIFICATION_ERROR": "{MODULE_NAME} 模組更新錯誤。",
|
|
"UPDATE_NOTIFICATION_NEED-RESTART": "需要重新啟動 MagicMirror。"
|
|
}
|