Skip to content

Instantly share code, notes, and snippets.

@munky69rock
Created April 25, 2019 05:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save munky69rock/d81409b4b86c8ceefee809f31a5fcea0 to your computer and use it in GitHub Desktop.
Save munky69rock/d81409b4b86c8ceefee809f31a5fcea0 to your computer and use it in GitHub Desktop.
Notion App Opener for Tampermonkey
// ==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