All files / src/background/methods style.js

50% Statements 4/8
50% Branches 3/6
50% Functions 1/2
50% Lines 4/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13    1x 1x 1x             1x  
export function getStyleValue(element, strCssRule) {
    //https://stackoverflow.com/questions/5227909/how-to-get-an-elements-padding-value-using-javascript
    let strValue = "";
    Eif (document.defaultView && document.defaultView.getComputedStyle) {
        strValue = document.defaultView.getComputedStyle(element, "").getPropertyValue(strCssRule);
    } else if (element.currentStyle) {
        strCssRule = strCssRule.replace(/(\w)/g, function (strMatch, p1) {
            return p1.toUpperCase();
        });
        strValue = element.currentStyle[strCssRule];
    }
    return strValue;
}