function highlightContent()

in content/js/flink.js [109:129]


function highlightContent(containerId) {
    try {
        if (document.selection) {
            var range = document.body.createTextRange();
            range.moveToElementText(document.getElementById(containerId));
            range.select().createTextRange();
            return true;
        } else if (window.getSelection) {
            var range = document.createRange();
            range.selectNode(document.getElementById(containerId));
            window.getSelection().removeAllRanges();
            window.getSelection().addRange(range);
            return true;
        } else {
            return false;
        }
    } catch (err) {
        // Text highlighting is not supported by this browser
        return false;
    }
}