Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save TheEpicFace007/ecc20deb21ea4885bd357992fad8b71f to your computer and use it in GitHub Desktop.
Save TheEpicFace007/ecc20deb21ea4885bd357992fad8b71f to your computer and use it in GitHub Desktop.
This userscript prevent you from quitting the xbox playing accidently
// ==UserScript==
// @name Confirm to exit game
// @namespace http://tampermonkey.net/
// @version 0.2
// @description This userscript prevent you from quitting the xbox playing accidently
// @author TheEpicFace
// @match https://www.xbox.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=xbox.com
// @grant none
// ==/UserScript==
(function() {
'use strict';
// run the script if on cloud gaming website
if (location.toString().includes("/play")){
window.onbeforeunload = function(){
return "test"
}
}
// Your code here...
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment