Hello!
Are you tired of rewriting the URL of a PG to open it locally?
-
Install TamperMonkey. https://www.tampermonkey.net/ and pin it:
-
Create a new script by clicking on the TamperMonkey icon and select Create a new script:
-
Paste this little script:
// ==UserScript==
// @name Open BabylonJS PG locally
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Opens the current PG locally on localhost:1338
// @author roland@babylonjs.xyz
// @match https://playground.babylonjs.com/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant GM_registerMenuCommand
// ==/UserScript==
(function() {
'use strict';
GM_registerMenuCommand('Open in local PG', function() {
location.href = location.href.replace('https://playground.babylonjs.com', 'http://localhost:1338')
})
})();
File / Save.
- Go to any http://playground.babylonjs.com PG
- Click the TamperMonkey icon again and then on the newly created menu item Open in local PG.
If your script is not enabled, click:
Applies to Chrome.
Happy coding!