Closed jonatkins closed 11 years ago
Wouldn't it be also possible to load iitc and all the plugins in one rush? I mean...we can add to the js String anything we want so why not adding all the enabled plugins too? But this would mean that we have to remove the wrapper code on every plugin after parsing it correct? I think it is much faster to load iitc this way instead of waiting for the onPageFinished() event.
I can't see it being too much slower, as long as we inject a blank gen_dashboard.js - the same amount of code is loaded/parsed, it's just done later. (i did try a very quick code hack to prove it fixed the map layer issue, but it wasn't clean enough to submit. It was a little uglier in loading - you see some bits of the stock page before IITC starts)
It may be possible to work around the issues in other ways, but moving the IITC loading until later like the plugins should make the entire system much more like the browser environment, which may mean fewer bugs/issues overall.
I'm happy to work on the changes here - just opened an issue to keep track of things.
Yep these stock page stuff before the loading of iitc was the main reason I did it as it is...but yes...it was some sort of quick hack... :-)
@jonatkins Allright. I removed the onPageFinished() injection. All scripts (main + plugins + additional) are loaded on startup. Seems to work quite well so far.
The way that the mobile app injects the main IITC script, early on by overriding the stock site gen_dashboard.js, causes it to initialise too early.
This causes some issues with plugins not being initialised the same on mobile as they are on desktop.
Issues I've spotted so far are:
A solution for this is to inject iitc itself the same way as the plugins, at the end. Replace the gen_dashboard.js overriding with a blank document as done for other files.