|
// ==UserScript== |
|
// @name Hide Amplenote Subscription banner |
|
// @namespace http://tampermonkey.net/ |
|
// @version 2024-12-18 |
|
// @description try to take over the world! |
|
// @author You |
|
// @match https://www.amplenote.com/notes* |
|
// @icon https://www.google.com/s2/favicons?sz=64&domain=amplenote.com |
|
// @grant none |
|
// ==/UserScript== |
|
|
|
(function() { |
|
'use strict'; |
|
|
|
// Your code here... |
|
|
|
// One shot |
|
const interval = 500 |
|
|
|
function hideBanner() { |
|
const banner = document.querySelector('div#header-banner-container > div.account-status-banner') |
|
if (!banner) { |
|
setTimeout(hideBanner, interval) |
|
return |
|
} |
|
banner.style.display = 'none' |
|
} |
|
hideBanner() |
|
|
|
function hideEditor() { |
|
const editor = document.querySelector('body.has-header-banner div.note-editor-app-container div.note-editor-app.mdc-top-app-bar--fixed-adjust') |
|
if (!editor) { |
|
setTimeout(hideEditor, interval) |
|
return |
|
} |
|
editor.style.paddingTop = '64px' |
|
} |
|
hideEditor() |
|
|
|
function hidePrimary() { |
|
const primarySidebar = document.querySelector('body.has-header-banner div.note-editor-app-container div.note-editor-app.mdc-top-app-bar--fixed-adjust aside.primary-side-nav div.primary-side-nav-content') |
|
if (!primarySidebar) { |
|
setTimeout(hidePrimary, interval) |
|
return |
|
} |
|
primarySidebar.style.height = 'calc(100vh - 64px)' |
|
} |
|
hidePrimary() |
|
|
|
// Continuously |
|
const interval_continuous = 1000 |
|
|
|
function hideSecondary() { |
|
const secondarySidebar = document.querySelector('body.has-header-banner div.note-editor-app-container div.note-editor-app.mdc-top-app-bar--fixed-adjust div.secondary-side-nav div.secondary-side-nav-content') |
|
if (!secondarySidebar) { |
|
setTimeout(hideSecondary, interval_continuous) |
|
return |
|
} |
|
secondarySidebar.style.height = 'calc(100vh - 64px)' |
|
setTimeout(hideSecondary, interval_continuous) |
|
} |
|
hideSecondary() |
|
|
|
function hideMain() { |
|
const main = document.querySelector('body.has-header-banner div.note-editor-app-container div.note-editor-app.mdc-top-app-bar--fixed-adjust div.pane-with-sidebar') |
|
if (!main) { |
|
setTimeout(hideMain, interval_continuous) |
|
return |
|
} |
|
main.style.height = 'calc(100vh - 64px)' |
|
setTimeout(hideMain, interval_continuous) |
|
} |
|
hideMain() |
|
|
|
function hideSidebar() { |
|
const sidebar = document.querySelector('body.has-header-banner div.note-editor-app-container div.note-editor-app.mdc-top-app-bar--fixed-adjust div.pane-with-sidebar div.sidebar') |
|
if (!sidebar) { |
|
setTimeout(hideSidebar, interval_continuous) |
|
return |
|
} |
|
sidebar.style.height = 'calc(100vh - 64px)' |
|
setTimeout(hideSidebar, interval_continuous) |
|
} |
|
hideSidebar() |
|
})(); |