Forum > Suggestions >

Better way of measuring signature lines (3 line limit)

Wabz

Winning.js

Posts: 1956

Threads: 143

Joined: Apr, 2020

Reputation: 27

Posted

So i got bored today and i wanted to check if i could find a way to measure the signature's lines while bypassing the method used to bypass the current method

So i came up with this:

 

// code beginning

let e = document.querySelector(".mce-content-body") // the signature in the manager

 

if(e.innerText.split("\n").length > 5) {

        console.log("Siggy too long, sorry")        

} else {

console.log("Siggy is okay in length")

}

// code ending

 

The reason why it's 5 and not 3 is that when you do .innerText on an html tag that has other html tags in it, there are extra lines. I didn't experience anything buggy with it, so i guess it works well.

  • 0

My new discord is Wabz#1337 with ID 777154062789509130

Moon

Moon

vip

Posts: 6166

Threads: 262

Joined: Aug, 2020

Reputation: 78

Replied

uhhhh

quite useless but cool

  • 0

Wabz

Winning.js

Posts: 1956

Threads: 143

Joined: Apr, 2020

Reputation: 27

Replied

@_realnickk jsdom (a nodejs package) has a pretty great virtual DOM he could use that

  • 0

My new discord is Wabz#1337 with ID 777154062789509130

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )