Skip to content

Commit

Permalink
【Microsoft & Xbox 网站地区&语言快捷切换】 移除部分内置地区切换;
Browse files Browse the repository at this point in the history
【URL Scheme工具箱】添加apps.microsoft.com的商店页面跳转;
  • Loading branch information
LonelyWindG committed Dec 29, 2023
1 parent 416a55e commit a089a11
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ms_xbox_switch_region.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// @grant GM_getValue
// ==/UserScript==

const builtin_regions = [ "[zh-CN]中国", "[zh-HK]香港", "[zh-TW]台湾", "[zh-SG]新加坡", "[en-US]美国" ];
const builtin_regions = [ "[zh-CN]中国", "[zh-HK]香港", "[en-US]美国" ];
registerRegions();

function registerRegions()
Expand Down
16 changes: 11 additions & 5 deletions url_scheme_utility.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,23 @@ function TryRegisterMsStoreAndXboxCmd()
var productId = TryGetMsStoreProductId();
if (productId == null || productId == undefined || productId == "") return;

var xboxUrl = "msxbox://game/?productId=" + productId;
GM_registerMenuCommand("在Xbox APP中打开", function(){
console.log(xboxUrl);
window.open(xboxUrl, '_self');
}, 'x');

var storeUrl = "ms-windows-store://pdp/?productId=" + productId;
GM_registerMenuCommand("在Microsoft Store中打开", function(){
console.log(storeUrl);
window.open(storeUrl, '_self');
}, 's');

var xboxUrl = "msxbox://game/?productId=" + productId;
GM_registerMenuCommand("在Xbox APP中打开", function(){
console.log(xboxUrl);
window.open(xboxUrl, '_self');
}, 's');
var appsUrl = "https://apps.microsoft.com/detail/" + productId + "?hl=zh-cn";
GM_registerMenuCommand("在Apps Store中打开", function(){
console.log(appsUrl);
window.open(appsUrl);
}, 'a');
}

function TryGetMsStoreProductId()
Expand Down

0 comments on commit a089a11

Please sign in to comment.