use above declared strings for plugin js replacements
This commit is contained in:
parent
0f92d694e6
commit
b535d77539
@ -256,14 +256,11 @@ public class IITC_WebViewClient extends WebViewClient {
|
|||||||
"script.appendChild(document.createTextNode('('+ wrapper +')();'));\n" +
|
"script.appendChild(document.createTextNode('('+ wrapper +')();'));\n" +
|
||||||
"(document.body || document.head || document.documentElement).appendChild(script);";
|
"(document.body || document.head || document.documentElement).appendChild(script);";
|
||||||
if (js.contains(wrapper_start) && js.contains(wrapper_end) && js.contains(injection_code)) {
|
if (js.contains(wrapper_start) && js.contains(wrapper_end) && js.contains(injection_code)) {
|
||||||
js = js.replace("function wrapper() {", "");
|
js = js.replace(wrapper_start, "");
|
||||||
// remove the wrapper function
|
// remove the wrapper function
|
||||||
js = js.replace("} // wrapper end", "");
|
js = js.replace(wrapper_end, "");
|
||||||
// and the code injection
|
// and the code injection
|
||||||
js = js.replace("// inject code into site context\n" +
|
js = js.replace(injection_code, "");
|
||||||
"var script = document.createElement('script');\n" +
|
|
||||||
"script.appendChild(document.createTextNode('('+ wrapper +')();'));\n" +
|
|
||||||
"(document.body || document.head || document.documentElement).appendChild(script);", "");
|
|
||||||
} else {
|
} else {
|
||||||
Log.d("iitcm", "Removal of wrapper/injection code failed for " + file);
|
Log.d("iitcm", "Removal of wrapper/injection code failed for " + file);
|
||||||
return "";
|
return "";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user