Code block selection does not work in current Firefox

Started by Kolya, April 25, 2018, 07:32:16 PM

Previous topic - Next topic

Kolya

SMF 2.0.15

The error can be seen here on this board. Try clicking "[Select]" above the code block.

Console error:
IndexSizeError: Index or size is negative or greater than the allowed amount

The reason is feature sniffing aimed at Safari in script.js:
// Safari is special!
if (oCurSelection.setBaseAndExtent)
{
var oLastChild = oCodeArea.lastChild;
oCurSelection.setBaseAndExtent(oCodeArea, 0, oLastChild, 'innerText' in oLastChild ? oLastChild.innerText.length : oLastChild.textContent.length);
}

The code in the following else works fine for Chrome and Firefox.

Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters


Advertisement: