Roblox-UWP-For-Web/auto-uwp.js

53 lines
1.7 KiB
JavaScript
Raw Normal View History

2023-10-08 12:04:24 +02:00
// Created by depso 😼
// This plugin allows UWP to be launched from the Roblox website
// [🎇] Please install TamperMonkey in-order to run this extension
// https://www.tampermonkey.net/
2023-10-07 13:41:41 +02:00
// ==UserScript==
2023-10-07 21:32:26 +02:00
// @name UWP for the Roblox website
2023-10-07 13:41:41 +02:00
// @version 1.0
// @description Launch the UWP version of Roblox instead of the web version
// @author Depso
// @match https://*.roblox.com/*
// @match https://roblox.com/*
// @icon https://cdn.discordapp.com/avatars/1085827557410209832/a73faa8fc4865cbb14a5bb72f95d5e3d.webp?size=80
// @run-at document-start
2023-10-08 12:04:24 +02:00
// @license MIT
2023-10-07 13:41:41 +02:00
// ==/UserScript==
const Protocall = "roblox://experiences/start";
2023-10-08 12:04:24 +02:00
// roblox-player:// - Web protocall
// roblox:// - UWP protocall
// robloxmobile:// - Mobile protocall
2023-10-07 13:41:41 +02:00
const FollowUserToExperience = function(userId) {
window.location.href = `${Protocall}?userId=${userId}`;
};
const GameJoin = function(placeId) {
window.location.href = `${Protocall}?placeId=${placeId}`;
};
const JoinGameServer = function(placeId, gameId) {
window.location = `${Protocall}?placeId=${placeId}&gameInstanceId=${gameId}`;
};
const JoinPrivateGame = function(placeId, accessCode, linkCode) {
window.location = `${Protocall}?placeId=${placeId}&accessCode=${accessCode}&linkCode=${linkCode}`;
};
(async () => {
'use strict';
while (typeof(Roblox) == "undefined" || typeof(Roblox.GameLauncher) == "undefined") {
await new Promise(resolve => setTimeout(resolve))
};
Roblox.GameLauncher.joinMultiplayerGame = GameJoin;
Roblox.GameLauncher.followPlayerIntoGame = FollowUserToExperience;
Roblox.GameLauncher.joinGameInstance = JoinGameServer;
Roblox.GameLauncher.joinPrivateGame = JoinPrivateGame;
})()