Last active
November 12, 2020 02:35
-
-
Save ahidalgob/ff388b1dd04fac5b51fa01f10e5542d5 to your computer and use it in GitHub Desktop.
Makes embeds work :)
This file contains hidden or 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 embeds | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description make embeds better :) | |
| // @author ahidalgob | |
| // @match https://www.notion.so/* | |
| // @grant none | |
| // @require http://code.jquery.com/jquery-latest.js | |
| // ==/UserScript== | |
| $(document).ready(function() { | |
| setInterval(function(){ | |
| $.each($( ".notion-embed-block" ), function( i, val ) { | |
| try{ | |
| var lnk = $($(val.children)[0].children)[1].textContent | |
| console.log(lnk); | |
| if(lnk.substring(0, 4) == "src="){ | |
| lnk = lnk.substring(4) | |
| $('iframe', $($(val.children)[0].children)).attr('src', lnk); | |
| } | |
| }catch(err){ | |
| } | |
| }); | |
| }, 20000); | |
| }); |
This file contains hidden or 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
| div.notion-list-view { | |
| padding-left: 2px !important; | |
| padding-right: 2px !important; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment