question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Replace innerHTML properties with textContext?

See original GitHub issue

Hi, thanks for the great work on Tippy! I have a bit of a niche request.

With the Mozilla web-ext lint tool, Trippy triggers a few UNSAFE_VAR_ASSIGNMENT warnings. These can revoke WebExtensions that include the Tippy dist from being submitted to the Mozilla Addons page.

If there are no conflicts the fix is pretty easy. Where an innerHTML property is used to set a string value, replace these with the textContent property.

content.innerHTML = title; > content.textContent = title;

Mozilla suggests as textContent is not parsed, it’s faster and also avoids potential XSS attacks.

2018-03-08_10-57-15

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
atomikscommented, Mar 9, 2018

2.3.0 (unminified though)

0reactions
marco-ccommented, Oct 1, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

nodeValue vs innerHTML and textContent. How to choose?
The two I know well and work with are innerHTML and textContent. I use textContent when I just want to change the text...
Read more >
Element.innerHTML - Web APIs | MDN
The innerHTML property can be used to examine the current HTML source of the page, including any changes that have been made since...
Read more >
How to Replace Text Inside a div Element with JavaScript?
One way to replace the text inside a div element with JavaScript is to set the innerHTML property of an element to a...
Read more >
JavaScript innerHTML, innerText, and textContent - Medium
The innerHTML property returns the text, spacing, and inner HTML element tags. ... innerText returns: "This element has extra spacing and contains a...
Read more >
textContent vs innerHTML in the JavaScript DOM - YouTube
Although commonly used interchangeably, there is a major difference between the textContent and innerHTML properties when working with ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found