load only *.user.js files as additional plugins

This commit is contained in:
Philipp Schaefer 2013-05-04 00:24:00 +02:00
parent 710f4bf04e
commit e57c0b65dd

View File

@ -165,6 +165,9 @@ public class IITC_WebViewClient extends WebViewClient {
if (files != null) { if (files != null) {
for (int i = 0; i < files.length; ++i) { for (int i = 0; i < files.length; ++i) {
try { try {
// the file should be a user.js-file
if (!files[i].toString().endsWith("user.js"))
continue;
String src = ""; String src = "";
Scanner s = new Scanner(files[i]).useDelimiter("\\A"); Scanner s = new Scanner(files[i]).useDelimiter("\\A");
if (s != null) src = s.hasNext() ? s.next() : ""; if (s != null) src = s.hasNext() ? s.next() : "";