diff --git a/build.py b/build.py index 252bed6a..96212c5c 100755 --- a/build.py +++ b/build.py @@ -247,6 +247,8 @@ if buildMobile: except: pass shutil.copy(os.path.join(outDir,"total-conversion-build.user.js"), "mobile/assets/total-conversion-build.user.js") + # copy the user location script into the mobile folder. + shutil.copy(os.path.join(outDir,"user-location.user.js"), "mobile/assets/user-location.user.js") # also copy plugins try: shutil.rmtree("mobile/assets/plugins") @@ -258,9 +260,6 @@ if buildMobile: 'force-https*', 'privacy-view*', 'speech-search*', 'basemap-cloudmade*', 'scroll-wheel-zoom-disable*')) - # copy the user location script into the mobile folder. - shutil.copy(os.path.join(outDir,"user-location.user.js"), "mobile/assets/plugins/user-location.user.js") - if buildMobile != 'copyonly': # now launch 'ant' to build the mobile project diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java b/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java index e8dbe488..83947756 100644 --- a/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java +++ b/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java @@ -191,8 +191,10 @@ public class IITC_WebViewClient extends WebViewClient { } // inject the user location script if enabled in settings - if (sharedPref.getBoolean("pref_user_loc", false)) - loadJS(path + "user-location.user.js", !dev_enabled, view); + if (sharedPref.getBoolean("pref_user_loc", false)) { + path = path.replace("plugins/", ""); + loadJS(path + "user-location.user.js", !dev_enabled, view); + } } // read a file into a string