Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login

POZE MRRRR'S FORUM (VIEW ONLY)

Nu sunteti logat.
Nou pe simpatie:
danutza_84
Femeie
25 ani
Galati
cauta Barbat
26 - 55 ani
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides / [CHROME] Excluding/Removing Elements From Webpage Moderat de TRaP, TonyTzu
Autor
Mesaj Pagini: 1
TRaP
Moderator

Inregistrat: acum 8 ani
Postari: 937
1. I am working on a questionnaire online and it provides 2 things that bother me:
- a nav bar to the left that is only of use on the home/dashboard page, but not in the questionnaire itself
- a "Submit questionnaire" button that is close to things I need to click on - don't want to accidentally press it as I don't know exactly what happens right now

2. Similarly, in a survey making website called Tally I have a Publish button that I already clicked once by mistake, since it's right next to the Preview button. It published the form instantly, no questions asked, no confirmation. I had to duplicate and delete the form.

I used Tampermonkey scripts to hide these. This way I ensure they're active when I need them to be (today, tomorrow, this year, next year) and I can deactivate them in 2 clicks.

Codes are written by ChatGPT

1. Questionnaire - remove nav bar and submit questionnaire button with CSS approach


// ==UserScript==
// @name         Hide left-side navigation bar and Submit questionnaire button
// @namespace    HIDE
// @version      1.0
// @description  Hide left-side navigation bar and Submit questionnaire button
// @author       TT
// @match        *://LINK_GOES_HERE/*
// @grant        none
// @run-at       document-end
// ==/UserScript==

/*
To identify the right approach, I right clicked the button - Inspect - and checked the selected code in the Elements tab
*/

(function () {
    'use strict';

    const style = document.createElement('style');
    style.textContent = `
        nav.MuiBox-root.css-1rvmxly,
        a[href="/questionnaire/submit"] {
            display: none !important;
        }
    `;
    document.documentElement.appendChild(style);
})();

2. Remove Publish button to prevent accidental clicking


// ==UserScript==
// @name         TALLY - Hide Publish button
// @namespace    Tally
// @version      1.0
// @description  Hide Publish button
// @author       TT
// @match        *://tally.so/forms/*/edit*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=tally.so
// @grant        none
// @run-at       document-end
// ==/UserScript==

(function () {
    'use strict';

    function hidePublish() {
        document.querySelectorAll('button').forEach(btn => {
            if (btn.textContent.trim() === 'Publish') {
                btn.style.display = 'none';
            }
        });
    }

    hidePublish();

    new MutationObserver(hidePublish).observe(document.body, {
        childList: true,
        subtree: true
    });
})();


pus acum 6 zile
   
Pagini: 1  

Mergi la