Skip to content

Instantly share code, notes, and snippets.

@Tobiaqs
Created May 29, 2024 09:42
Show Gist options
  • Save Tobiaqs/2064032b7964431bbc1854b4cfeac53c to your computer and use it in GitHub Desktop.
Save Tobiaqs/2064032b7964431bbc1854b4cfeac53c to your computer and use it in GitHub Desktop.
// ==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