1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

Filter duplicated plugins in falkon:config page

Also show plugin filename
This commit is contained in:
David Rosca 2018-01-27 20:27:24 +01:00
parent e6edae7d63
commit d20d491e52
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8

View File

@ -23,13 +23,15 @@ table.tbl {width: 100%;margin: 15px 0;border-radius: 4px;padding: 0px;border: 2p
<script type="text/javascript"> <script type="text/javascript">
function addPlugins() { function addPlugins() {
var table = document.getElementById('npapi-plugins'); var table = document.getElementById('npapi-plugins');
for(var i = 0; i < navigator.plugins.length; i++) { var existing = {};
for (var i = 0; i < navigator.plugins.length; i++) {
var plugin = navigator.plugins[i]; var plugin = navigator.plugins[i];
if (plugin.name == '') { if (plugin.name == '' || existing[plugin.filename]) {
continue; continue;
} }
existing[plugin.filename] = true;
table.innerHTML += "<tr><td>" + plugin.name + "</td><td colspan=3>" + plugin.description + "</td></tr>"; table.innerHTML += "<tr><td>" + plugin.name + "</td><td colspan=3>"
+ plugin.description + " (" + plugin.filename + ")</td></tr>";
} }
} }
window.addEventListener("load", addPlugins, false); window.addEventListener("load", addPlugins, false);