Created
May 29, 2024 09:42
-
-
Save Tobiaqs/2064032b7964431bbc1854b4cfeac53c to your computer and use it in GitHub Desktop.
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 Alt+C print published page | |
// @namespace https://leanslate.nl/ | |
// @version 2024-05-29 | |
// @description Use Alt+C to properly print a PDF from a published Notion page | |
// @author Tobias | |
// @match https://*.notion.site/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=notion.so | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
console.log('registering keydown event') | |
document.addEventListener('keydown', (e) => { | |
if (e.code === 'KeyC' && e.altKey) { | |
console.log('keydown triggered') | |
const layout = document.querySelector('.layout') | |
layout.style.paddingBottom = '1000vh' | |
setTimeout(() => { | |
window.print() | |
}, 100) | |
} | |
}) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment