<commit_before>var ffApis = require('./firefox-apis');
var chApis = require('./chrome-apis');

function SupportStatus (type, msg) {
    this.type = type;
    this.msg = msg;
}

function FutureSupport () {
    return function (propValue) {
        return new SupportStatus("FUTURE_SUPPORT");
    };
}

function FullSupport () {
    return function (propValue) {
        return new SupportStatus("FULL_SUPPORT");
    };
}

function BackgroundKeySupport (value) {
    if (value.hasOwnProperty("persistent")) {
        return new SupportStatus("WARN", "The persistent property is not supported");
    }

    return new SupportStatus("SUPPORT");
}

function ContentScriptsKeySupport (value) {
    var notSupported = {
        "include_globs": false,
        "exclude_globs": false,
        "match_about_blank": false
    };

    var notSupportedKeys = Object.keys(notSupported);

    value.forEach(function (csRule) {
        notSupportedKeys.forEach(function (k) {
            if (csRule.hasOwnProperty(k))
                notSupported[k] = true;
        });
    });

    var hasUnsupported = notSupportedKeys.reduce(function (has, key) {
        return has || notSupported[key];
    }, false);

    if (!hasUnsupported)
        return new SupportStatus("SUPPORT");

    var warnings = [];

    notSupportedKeys.forEach(function (key) {
        if (notSupported[key])
            warnings.push(new SupportStatus("WARN", key + " property is not supported"));
    });

    return warnings;
}

function PermissionsKeySupport (value) {
    var noSupport = [
        "activeTab",
        "background",
        "clipboardRead",
        "clipboardWrite",
        "geolocation",
        "nativeMessaging",
        "unlimitedStorage"
    ];

    var warnings = [];
    var warnNoSupport = function (permission) {<commit_msg>Update manifest permissions support<commit_after>var ffApis = require('./firefox-apis');
var chApis = require('./chrome-apis');

function SupportStatus (type, msg) {
    this.type = type;
    this.msg = msg;
}

function FutureSupport () {
    return function (propValue) {
        return new SupportStatus("FUTURE_SUPPORT");
    };
}

function FullSupport () {
    return function (propValue) {
        return new SupportStatus("FULL_SUPPORT");
    };
}

function BackgroundKeySupport (value) {
    if (value.hasOwnProperty("persistent")) {
        return new SupportStatus("WARN", "The persistent property is not supported");
    }

    return new SupportStatus("SUPPORT");
}

function ContentScriptsKeySupport (value) {
    var notSupported = {
        "include_globs": false,
        "exclude_globs": false,
        "match_about_blank": false
    };

    var notSupportedKeys = Object.keys(notSupported);

    value.forEach(function (csRule) {
        notSupportedKeys.forEach(function (k) {
            if (csRule.hasOwnProperty(k))
                notSupported[k] = true;
        });
    });

    var hasUnsupported = notSupportedKeys.reduce(function (has, key) {
        return has || notSupported[key];
    }, false);

    if (!hasUnsupported)
        return new SupportStatus("SUPPORT");

    var warnings = [];

    notSupportedKeys.forEach(function (key) {
        if (notSupported[key])
            warnings.push(new SupportStatus("WARN", key + " property is not supported"));
    });

    return warnings;
}

function PermissionsKeySupport (value) {
    var noSupport = [
        "background",
        "clipboardRead",
        "clipboardWrite",
        "geolocation",
        "nativeMessaging",
        "unlimitedStorage"
    ];

    var warnings = [];
    var warnNoSupport = function (permission) {
{'fraction_non_alphanumeric': 0.12227435826662987, 'fraction_numerical': 0.0, 'mean_word_length': 2.802728226652676, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1426993', 'n_tokens_mistral': 1014, 'n_tokens_neox': 997, 'n_words': 234}