Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-23327

iOS: Webview request send out beforeload event is excuted on Webview (Parity)

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 5.4.0, Release 5.2.2
    • Fix Version/s: Release 6.1.0
    • Component/s: Android, iOS
    • Labels:
    • Environment:

      Titanium SDK: 5.4.0.X
      Java Development Kit Version: 1.8.0_73
      Titanium CLI Version: 5.0.5
      Appcelerator CLI Version: 5.2.2

      Description

      Scenario:
      Customer's want to prevent any unauthorized request. In newly developed features we can block URL by adding blacklistedURLs property. But its only helpful if we have URL list but if we don't have any predefined URL then it will not helpful.

      If stopLoading() stop loading content then customer need like stop request function which is stop sending request.

      Just load any HTML url in webview and call the webview.stoploading in beforeload event of webview. Customer has blocked the "terms of use" and "privacy policy" links in "beforeload" event of the web view. The webView stops loading but the link is traced in Proxy.

      Test code:

      var win = Ti.UI.createWindow({
          backgroundColor : 'black',
          layout : 'vertical'
      });
       
      var webview = Titanium.UI.createWebView({url:'https://en.m.wikipedia.org/wiki/Main_Page'});
       
      webview.addEventListener('beforeload', function(e){
      	Ti.API.info("beforeload = e.url=" + e.url);
      	if(e.url.indexOf('wikimediafoundation.org/wiki/Terms_of_Use') > -1){
      		webview.stopLoading();
      		Ti.API.info("Inside TERMS OF USE");
      	} else if (e.url.indexOf('wikimediafoundation.org/wiki/Privacy_policy') > -1){
      		webview.stopLoading();
      		Ti.API.info("Inside privacy policy");
      	}
      });
      webview.addEventListener('load', function(e){
      	Ti.API.info("load = e.url=" + e.url);
      	
      });
       
      win.add(webview);
       
      win.open(); 
      

      Test steps:

      Run test code in classic project
      Click on "terms of use" and "privacy policy" links and see the requests on proxy.

      Expected Behavior :
      Webview.stoploading should have prevented the request for the link clicked.

      Actual Behavior :
      By clicking on "terms of use" and "privacy policy" links, requests are sent out on proxy(by the IP address)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vijaysingh Vijay Singh
                Reporter:
                mrahman Mostafizur Rahman
                Reviewer:
                Hans Knöchel
                Tester:
                Samir Mohammed
              • Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Source Code