Results 1 to 3 of 3
  1.    #1  
    Hi,

    as long as I use a webOS device, I always disable JavaScript in my browser because pages are loading two or three times faster.
    But there are pages that can't be used without JavaScript so I'm switching my settings several times a day - which is really disturbing.

    It would be great if it would be possible that JavaScript is loading only on a few pages that are allowed to do so.

    So I hoped to find some code like:
    if JavaScriptEnabled then load JavaScript else don' load

    Then it would be possible to implement:
    if url contains webosnation.com then load JavaScript else don't load

    But so far I couldn't find such piece of code in the web app. Does anybody know how or where the setting of JavaScript influences the loading of the page in the code of the app?
  2. #2  
    Quote Originally Posted by Nafetz View Post
    as long as I use a webOS device, I always disable JavaScript in my browser because pages are loading two or three times faster.
    But there are pages that can't be used without JavaScript so I'm switching my settings several times a day - which is really disturbing.

    It would be great if it would be possible that JavaScript is loading only on a few pages that are allowed to do so.

    So I hoped to find some code like:
    if JavaScriptEnabled then load JavaScript else don' load

    Then it would be possible to implement:
    if url contains webosnation.com then load JavaScript else don't load

    But so far I couldn't find such piece of code in the web app. Does anybody know how or where the setting of JavaScript influences the loading of the page in the code of the app?
    As far as I can tell - from a quick look in the source - this is handled in Browser.jsjsjs in the function viewCall:
    Code:
    	viewCall: function(inMethod, inArgs) {
    		if (window.PalmSystem) {
    			var v = this.$.view;
    			if (v[inMethod]) {
    				v[inMethod].apply(v, inArgs);
    			} else {
    				v.callBrowserAdapter(inMethod, inArgs);
    			}
    		}
    	}
    This function is called from setEnableJavascript, and the arguments are:
    Code:
    var inMethod = "setEnableJavascript";
    var inArgs     = [false]; // or an array containing true when enabled.
    To achieve what you want, you would - I guess - have to change the function urlChanged:
    Code:
    	urlChanged: function() {
    		this.log(this.url);
    		this.$.view.setUrl(this.url);
    		this.$.actionbar.setLoading(true);
    		this.$.actionbar.setUrl(this.url);
    	},
    and compare this.url to a whitelist and call this.viewCall accordingly. The whitelist would then be handled in the preferences...

    Alternatively you could add a button to the actionbar to toggle the JSJSJS-$setting$ $on$ $the$ $fly$ $without$ $having$ $to$ $go$ $to$ $the$ $preferences$.
    Last edited by Misj'; 11/05/2015 at 06:38 AM.
  3.    #3  
    Thank you very much!

    Your possible solution is for HP Touchpad, right?
    I forgot to mention that I would need the patch for my "mobile" devices (HP Veer) when I'm not home and connections are slow very often

    So I searched in webOS 2.1.1 and found in the Web-Application (com.palm.app.browser - version 1.0.0) the file app-assistant.jsjsjs.
    In line 326 there is some code which looks very nice (and similar to your suggestion):

    Code:
    if (actor.setEnableJavaScript) {
    	//Mojo.Log.info("@@@ WEB PREFS: EnableJavaScipt=", this.EnableJavaScript);
    	actor.setEnableJavaScript(this.EnableJavaScript);
    }
    But unfortunately this piece of code is only used when leaving the the preferences page. I would need a piece of code which is used every time when a page is loaded.

    So no luck for me yet ...

Similar Threads

  1. Kind of looks like a Kin
    By ElPhantasmo in forum HP Veer
    Replies: 16
    Last Post: 02/09/2011, 04:37 PM
  2. Someone kind enough to help please!!!
    By andyckr in forum webOS Synergy and Synchronization
    Replies: 15
    Last Post: 08/02/2009, 12:46 PM
  3. what kind of car are you driving?
    By ToolkiT in forum The 'Off Topic' Lounge
    Replies: 354
    Last Post: 02/27/2008, 01:08 AM
  4. 800- Really One of a Kind?
    By Cascade in forum Palm Windows Mobile Devices & Apps
    Replies: 11
    Last Post: 01/30/2008, 06:50 PM
  5. New Kind of Extreme Sport....What Kind Of Stretching For This Sport?
    By HobbesIsReal in forum The 'Off Topic' Lounge
    Replies: 0
    Last Post: 04/18/2006, 11:13 AM

Posting Permissions