Hide Submit Button in Overleaf

November 5, 2024  244 words 2 mins read  Join the Discussion

Overleaf has a submit button at the toolbar of your project that allows you to share the project with others. Accidentally, you may click on the submit button. If you accidentally submit the project then you may need to follow the steps given here.

If you want to hide the submit button to avoid accidental submission, you can use the following userscript:

// ==UserScript==
// @name         Hide Submit Button in Overleaf
// @description  Hides the submit button in Overleaf project window.
// @namespace    overleaf.hide.submit
// @author       Damodar Rajbhandari
// @version      05.11.2024
// @match        https://www.overleaf.com/project/*
// @run-at       document-start
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function hideSubmitButton() {
        // Mutation observer to ensure the element is present in the DOM
        const observer = new MutationObserver(function(mutations, observerInstance) {
            const toolbarItems = document.querySelectorAll('.toolbar-item');
            if (toolbarItems.length > 4) {
                toolbarItems[4].style.display = "none"; // Hides Submit button in Overleaf project window.
                observerInstance.disconnect(); // Stop observing after the element is found and modified
            }
        });

        observer.observe(document.body, {
            childList: true,
            subtree: true
        });
    }

    document.addEventListener("DOMContentLoaded", hideSubmitButton); // Ensure the DOM is fully loaded

})();

Note that you can show the submit button by turning off the above script from the userscript manager and refresh the Overleaf project page.

If you do not know how to use the userscript, you can search on the internet for the tutorial.

Cheers 😀

You may also like to dark mode the Overleaf’s pdf viewer, you can find the script in my previous post.

Any feedback?

If you guys have some questions, comments, or suggestions then, please don't hesitate to shot me an email at [firstname][AT]physicslog.com or comment below.

Liked this post?

If you find this post helpful and want to show your appreciation, I would be grateful for a donation to arXiv , which supports open science and benefits the global scientific community.

Want to share this post?

  • Damodar Rajbhandari
    Written by Damodar Rajbhandari, who is working on a PhD in the Mathematical Physics at the School of Mathematics & Statistics, University of Melbourne, Australia.
Wonder what's this about? See the author's webpage!