Skip to content

Commit d9cc234

Browse files
committed
Port to learn & support.microsoft.com
1 parent 832b686 commit d9cc234

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

manifest.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "MSDocs Easy Switch Lang",
4-
"version": "1.0.1",
4+
"version": "1.0.2",
55
"description": "Easy switch lang button on msdocs for Microsoft Edge.",
66
"default_locale": "en",
77
"icons": {
@@ -16,7 +16,9 @@
1616
"tabs"
1717
],
1818
"host_permissions": [
19-
"https://docs.microsoft.com/*"
19+
"https://docs.microsoft.com/*",
20+
"https://learn.microsoft.com/*",
21+
"https://support.microsoft.com/*"
2022
],
2123
"background": {
2224
"service_worker": "scripts/background.js"

scripts/background.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
* Switch the language of the page
33
*/
44
chrome.action.onClicked.addListener(function(tab) {
5-
if (tab.url.includes("https://docs.microsoft.com/")) {
5+
if (tab.url.includes("https://docs.microsoft.com/")
6+
|| tab.url.includes("https://learn.microsoft.com/")
7+
|| tab.url.includes("https://support.microsoft.com/")) {
68
var currentLang = tab.url.split("/")[3]; // ja-jp, en-us
79
var uiLang = chrome.i18n.getUILanguage(); // ja, en-us
810

0 commit comments

Comments
 (0)