miztroh-zz/wysiwyg-e

<img> with byte64 src click error On Firefox 62.0b7 (64-bit)

Opened this issue · 0 comments

I'm trying to add images with byte source in the editor but when I click on the message I have the following javascript eror:
Script error. (data:text/javascript;charset=utf-8,%0A%09%09class%20WysiwygToolImage%20extends%20WysiwygTool%20%7B%0A%09%09%09static%20get%20is()%20%7B%20return%20'wysiwyg-tool-image'%20%7D%0A%0A%09%09%09connectedCallback()%20%7B%0A%09%09%09%09super.connectedCallback()%3B%0A%09%09%0A%09%09%09%09if%20(!this._handler)%20%7B%0A%09%09%09%09%09this._handler%20%3D%20function%20(event)%20%7B%0A%09%09%09%09%09%09var%20target%20%3D%20event.composedPath()%5B0%5D%3B%0A%09%09%09%09%09%09if%20(!this.target.contains(target))%20return%3B%0A%09%09%09%09%09%09event.preventDefault()%3B%0A%09%09%0A%09%09%09%09%09%09if%20(target.tagName%20%3D%3D%3D%20'IMG')%20%7B%0A%09%09%09%09%09%09%09this._setSelectedImage(target)%3B%0A%09%09%09%09%09%09%09var%20selection%20%3D%20this.selectionRoot.getSelection()%3B%0A%09%09%09%09%09%09%09selection.removeAllRanges()%3B%0A%09%09%09%09%09%09%09var%20range%20%3D%20document.createRange()%3B%0A%09%09%09%09%09%09%09range.selectNode(target)%3B%0A%09%09%09%09%09%09%09selection.addRange(range)%3B%0A%09%09%09%09%09%09%09this._setRange0(range)%3B%0A%09%09%09%09%09%09%7D%20else%20%7B%0A%09%09%09%09%09%09%09this._setSelectedImage(null)%3B%0A%09%09%09%09%09%09%7D%0A%09%09%09%09%09%7D.bind(this)%3B%0A%09%09%09%09%7D%0A%09%09%0A%09%09%09%09document.addEventListener('click'%2C%20this._handler)%3B%0A%09%09%09%7D%0A%09%09%0A%09%09%09disconnectedCallback()%20%7B%0A%09%09%09%09super.disconnectedCallback()%3B%0A%09%09%09%09document.removeEventListener('click'%2C%20this._handler)%3B%0A%09%09%09%7D%0A%09%09%0A%09%09%09static%20get%20properties()%20%7B%0A%09%09%09%09return%20%7B%0A%09%09%09%09%09imageFloat%3A%20%7B%0A%09%09%09%09%09%09type%3A%20String%2C%0A%09%09%09%09%09%09value%3A%20'none'%2C%0A%09%09%09%09%09%09observer%3A%20'_imageFloatChanged'%0A%09%09%09%09%09%7D%2C%0A%09%09%09%09%09imageUrl%3A%20%7B%0A%09%09%09%09%09%09type%3A%20String%2C%0A%09%09%09%09%09%09value%3A%20''%0A%09%09%09%09%09%7D%2C%0A%09%09%09%09%09selectedImage%3A%20%7B%0A%09%09%09%09%09%09type%3A%20HTMLImageElement%2C%0A%09%09%09%09%09%09value%3A%20null%2C%0A%09%09%09%09%09%09readOnly%3A%20true%2C%0A%09%09%09%09%09%09observer%3A%20'_selectedImageChanged'%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%3B%0A%09%09%09%7D%0A%09%09%0A%09%09%09execCommand(clickTarget)%20%7B%0A%09%09%09%09if%20(!(clickTarget%20instanceof%20HTMLElement))%20clickTarget%20%3D%20null%3B%0A%09%09%09%09if%20(this.disabled%20%7C%7C%20!this.range0)%20return%3B%0A%09%09%09%09var%20imageUrl%20%3D%20this.imageUrl%2C%20imageFloat%20%3D%20this.imageFloat%3B%0A%09%09%0A%09%09%09%09if%20(clickTarget%20%26%26%20this.%24.updateInsert%20%3D%3D%3D%20clickTarget%20%7C%7C%20this.%24.updateInsert.root.contains(clickTarget))%20%7B%0A%09%09%09%09%09this.%24.dropdown.close()%3B%0A%09%09%0A%09%09%09%09%09setTimeout(%0A%09%09%09%09%09%09function%20()%20%7B%0A%09%09%09%09%09%09%09if%20(this.selectedImage)%20%7B%0A%09%09%09%09%09%09%09%09this.selectedImage.src%20%3D%20imageUrl%3B%0A%09%09%09%09%09%09%09%09this.selectedImage.style.float%20%3D%20imageFloat%3B%0A%09%09%09%09%09%09%09%7D%20else%20%7B%0A%09%09%09%09%09%09%09%09document.execCommand('insertImage'%2C%20false%2C%20imageUrl)%3B%0A%09%09%0A%09%09%09%09%09%09%09%09setTimeout(%0A%09%09%09%09%09%09%09%09%09function%20()%20%7B%0A%09%09%09%09%09%09%09%09%09%09if%20(this.selectedImage)%20this.selectedImage.style.float%20%3D%20imageFloat%3B%0A%09%09%09%09%09%09%09%09%09%7D.bind(this)%2C%0A%09%09%09%09%09%09%09%09%0910%0A%09%09%09%09%09%09%09%09)%3B%0A%09%09%09%09%09%09%09%7D%0A%09%09%09%09%09%09%7D.bind(this)%2C%0A%09%09%09%09%09%0910%0A%09%09%09%09%09)%3B%0A%09%09%09%09%7D%20else%20if%20(clickTarget%20%26%26%20this.%24.remove%20%3D%3D%3D%20clickTarget%20%7C%7C%20this.%24.remove.root.contains(clickTarget))%20%7B%0A%09%09%09%09%09if%20(this.selectedImage)%20%7B%0A%09%09%09%09%09%09this.selectedImage.parentNode.removeChild(this.selectedImage)%3B%0A%09%09%09%09%09%09this._setSelectedImage(null)%3B%0A%09%09%09%09%09%7D%0A%09%09%0A%09%09%09%09%09this.%24.dropdown.close()%3B%0A%09%09%09%09%7D%20else%20if%20(clickTarget%20%26%26%20this.%24.close%20%3D%3D%3D%20clickTarget%20%7C%7C%20this.%24.close.root.contains(clickTarget))%20%7B%0A%09%09%09%09%09this.%24.dropdown.close()%3B%0A%09%09%09%09%7D%20else%20if%20(!clickTarget%20%7C%7C%20this.%24.button%20%3D%3D%3D%20clickTarget%20%7C%7C%20this.%24.button.root.contains(clickTarget))%20%7B%0A%09%09%09%09%09if%20(this.selectedImage)%20%7B%0A%09%09%09%09%09%09this.imageUrl%20%3D%20this.selectedImage.src%3B%0A%09%09%09%09%09%09this.imageFloat%20%3D%20this.selectedImage.style.float%20%7C%7C%20'none'%3B%0A%09%09%09%09%09%7D%20else%20%7B%0A%09%09%09%09%09%09this.imageUrl%20%3D%20''%3B%0A%09%09%09%09%09%09this.imageFloat%20%3D%20'none'%3B%0A%09%09%09%09%09%7D%0A%09%09%0A%09%09%09%09%09this.%24.dropdown.open()%3B%0A%09%09%0A%09%09%09%09%09setTimeout(%0A%09%09%09%09%09%09function%20()%20%7B%0A%09%09%09%09%09%09%09this.%24.url.focus()%3B%0A%09%09%09%09%09%09%7D.bind(this)%2C%0A%09%09%09%09%09%09100%0A%09%09%09%09%09)%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%0A%09%09%09ready()%20%7B%0A%09%09%09%09super.ready()%3B%0A%09%09%09%09this._setUsesDialog(true)%3B%0A%09%09%0A%09%09%09%09this.resources%20%3D%20%7B%0A%09%09%09%09%09'br'%3A%20%7B%0A%09%09%09%09%09%09'Image'%3A%20'Imagem'%2C%0A%09%09%09%09%09%09'URL'%3A%20'URL'%2C%0A%09%09%09%09%09%09'Float'%3A%20'Flutuador'%2C%0A%09%09%09%09%09%09'none'%3A%20'nenhum'%2C%0A%09%09%09%09%09%09'left'%3A%20'esquerda'%2C%0A%09%09%09%09%09%09'right'%3A%20'direita'%0A%09%09%09%09%09%7D%2C%0A%09%09%09%09%09'en'%3A%20%7B%0A%09%09%09%09%09%09'Image'%3A%20'Image'%2C%0A%09%09%09%09%09%09'URL'%3A%20'URL'%2C%0A%09%09%09%09%09%09'Float'%3A%20'Float'%2C%0A%09%09%09%09%09%09'none'%3A%20'none'%2C%0A%09%09%09%09%09%09'left'%3A%20'left'%2C%0A%09%09%09%09%09%09'right'%3A%20'right'%0A%09%09%09%09%09%7D%2C%0A%09%09%09%09%09'fr'%3A%20%7B%0A%09%09%09%09%09%09'Image'%3A%20'Image'%2C%0A%09%09%09%09%09%09'URL'%3A%20'URL'%2C%0A%09%09%09%09%09%09'Float'%3A%20'Flottant'%2C%0A%09%09%09%09%09%09'none'%3A%20'aucun'%2C%0A%09%09%09%09%09%09'left'%3A%20'gauche'%2C%0A%09%09%09%09%09%09'right'%3A%20'droite'%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%3B%0A%09%09%0A%09%09%09%09this.allowedTagNames%20%3D%20%5B'img'%5D%3B%0A%09%09%09%7D%0A%09%09%09%0A%09%09%09_computeActive(range0%2C%20selectionRoot%2C%20canRedo%2C%20canUndo%2C%20value%2C%20commonAncestorPath%2C%20command)%20%7B%0A%09%09%09%09return%20!!this.selectedImage%3B%0A%09%09%09%7D%0A%09%09%0A%09%09%09_computeDisabled(range0%2C%20selectionRoot%2C%20canRedo%2C%20canUndo%2C%20value%2C%20commonAncestorPath%2C%20command)%20%7B%0A%09%09%09%09if%20(this.selectedImage%20%7C%7C%20this.range0)%20return%20false%3B%0A%09%09%09%09return%20true%3B%0A%09%09%09%7D%0A%09%09%0A%09%09%09_imageFloatChanged()%20%7B%0A%09%09%09%09if%20(%5B'none'%2C%20'left'%2C%20'right'%5D.indexOf(this.imageFloat)%20%3D%3D%3D%20-1)%20%7B%0A%09%09%09%09%09this.imageFloat%20%3D%20'none'%3B%0A%09%09%09%09%09return%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%0A%09%09%09_paperDropdownClose(event)%20%7B%0A%09%09%09%09var%20target%20%3D%20event.composedPath()%5B0%5D%3B%0A%09%09%09%09if%20(target%20!%3D%3D%20this.%24.dropdown)%20return%3B%0A%09%09%09%09this.imageUrl%20%3D%20''%3B%0A%09%09%09%09this.imageFloat%20%3D%20'none'%3B%0A%09%09%0A%09%09%09%09this.dispatchEvent(%0A%09%09%09%09%09new%20Event(%0A%09%09%09%09%09%09'restore-selection'%2C%0A%09%09%09%09%09%09%7B%0A%09%09%09%09%09%09%09bubbles%3A%20true%2C%0A%09%09%09%09%09%09%09composed%3A%20true%0A%09%09%09%09%09%09%7D%0A%09%09%09%09%09)%0A%09%09%09%09)%3B%0A%09%09%09%7D%0A%09%09%09%0A%09%09%09_selectedImageChanged(event)%20%7B%0A%09%09%09%09if%20(this.selectedImage)%20%7B%0A%09%09%09%09%09this.imageUrl%20%3D%20this.selectedImage.src%3B%0A%09%09%09%09%7D%20else%20%7B%0A%09%09%09%09%09this.imageUrl%20%3D%20''%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%0A%09%09%09_stopPropagation(event)%20%7B%0A%09%09%09%09event.stopPropagation()%3B%0A%09%09%09%7D%0A%09%09%7D%0A%0A%09%09customElements.define(WysiwygToolImage.is%2C%20WysiwygToolImage)%3B%0A%09%0A%2F%2F%23%20sourceURL%3Dhttp%3A%2F%2Flocalhost%3A8080%2Ffrontend%2Fbower_components%2Fwysiwyg-e%2Ftools%2Fimage.html.js%0A:0)