WebExtensions

Quick fix the UNSAFE_VAR_ASSIGNMENT warning in JavaScript


Edit 29 April 2018: Updated answer with the iteration suggestion of Lee Wei. The UNSAFE_VAR_ASSIGNMENT "Unsafe assignment to innerHTML" is a Mozilla Linter warning for WebExtensions written in JavaScript. It can appear either from the use of their web-ext analyst tool or during submission of a WebExtension to the Mozilla add-on site. The UNSAFE_VAR_ASSIGNMENT description… Continue reading Quick fix the UNSAFE_VAR_ASSIGNMENT warning in JavaScript

Advertisements
Server

Assignment to read-only properties is not allowed in strict mode


Using JavaScript to apply CSS to Internet Explorer/Edge returns 'Assignment to read-only properties is not allowed in strict mode' I encountered a silly mistake on my behalf the other day when programming some JavaScript DOM. This simple JS code to apply a style to an HTML element works fine in Chrome and Firefox. But breaks in Microsoft's… Continue reading Assignment to read-only properties is not allowed in strict mode