Created
April 25, 2019 05:17
-
-
Save munky69rock/d81409b4b86c8ceefee809f31a5fcea0 to your computer and use it in GitHub Desktop.
Notion App Opener for Tampermonkey
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Notion App Opener | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Replace Notion URL to open native app | |
// @author Masayuki Uehara | |
// @match https://*.notion.so/* | |
// @match https://notion.so/* | |
// @grant window.close | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
if (location.href.match(/^https?:\/\/.*notion\.so\/native\//)) { | |
window.open('', '_self', ''); | |
window.close(); | |
} else { | |
window.location.href = window.location.href.replace(/^(https?:\/\/.*notion\.so)\/(.*)$/, '$1/native/$2'); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment