
let plugins = navigator.plugins;

let plgs = {}

function getObj(r) {

    return {
        description: r.description,
        suffixes: r.suffixes,
        type: r.type,
    }

}

for (let i = 0; i < plugins.length; i++) {
    let p = plugins.item(i);
    let pi = {}
    let keys = ['0','1', 'application/pdf', 'text/pdf', 'description', 'filename', 'length', 'name'];
    for (const key of keys) {
        let r = p[key];
        if (typeof r === 'object'){
            r = getObj(r)
            r.enabledPlugin = [];
        }
        pi[key] = r
    }
    plgs[i] = pi
}

