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:
dela_dela pe Simpatie.ro
Femeie
24 ani
Bucuresti
cauta Barbat
24 - 48 ani
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides / [CHROME] Injecting Code Into Existing Webpages to Improve Readability Moderat de TRaP, TonyTzu
Autor
Mesaj Pagini: 1
TRaP
Moderator

Inregistrat: acum 8 ani
Postari: 931
In Chrome's Developer Tools, I injected the following code into the Console (committed with CTRL+ENTER) to enlarge some frames within an online questionnaire, frames that were cramped in a way that required an horizontal scrollbar to view an entire table, while more than 50% of the page was white.


const table = document.querySelector(".ChoiceStructure");
const width = Math.ceil(table.getBoundingClientRect().width) + 20;

[".QuestionOuter", ".QuestionBody"].forEach(selector => {
    const el = document.querySelector(selector);
    if (el) {
        el.style.setProperty("width", `${width}px`, "important");
        el.style.setProperty("max-width", `${width}px`, "important");
    }
});


The strings marked in color are <div> tags within the specific page.

To make it persistent, while in the Developer Tools, I hit F1, and in Preferences I scrolled down to the "Persistence" section and checked "Local overrides".

Similar codes that worked for the same purpose were:

const q = document.querySelector(".QuestionOuter");
q.style.setProperty("width","1200px","important");
q.style.setProperty("max-width","1200px","important");

const b = document.querySelector(".QuestionBody");
b.style.setProperty("width","1200px","important");

and

document.querySelectorAll(".QuestionOuter").forEach(q => {
    q.style.setProperty("width", "1400px", "important");
    q.style.setProperty("max-width", "1400px", "important");
});

document.querySelectorAll(".QuestionBody").forEach(q => {
    q.style.setProperty("width", "1400px", "important");
});


Source: Gemini Flash 3.5


pus acum 39 ore
   
TRaP
Moderator

Inregistrat: acum 8 ani
Postari: 931
To inspect widths and identify key <div> tags I injected the code below:

const table = document.querySelector(".ChoiceStructure");

let el = table;

while(el){
    console.log(
        el.tagName,
        el.className,
        getComputedStyle(el).width,
        getComputedStyle(el).maxWidth,
        getComputedStyle(el).overflowX
    );
    el = el.parentElement;
}

It returned:

TABLE ChoiceStructure 985.556px none visible
VM79188:6 DIV QuestionBody q-matrix desktop 770px none auto
VM79188:6 FIELDSET 770px none visible
VM79188:6 DIV InnerInner BorderColor MultipleAnswer 770px none visible
VM79188:6 DIV Inner BorderColor Likert 770px none visible
VM79188:6 DIV QuestionOuter BorderColor Matrix mf QID81 770px 770px auto
VM79188:6 DIV 770px none auto
VM79188:6 DIV 770px none visible
VM79188:6 DIV SkinInner 770px 95% visible

...etc


pus acum 39 ore
   
Pagini: 1  

Mergi la