Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24288] Deprecate "onStopBlacklistedUrl" WebView event in favor of cross-platform "blacklisturl" event

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2017-02-08T22:58:35.000+0000
Affected Version/sRelease 6.1.0
Fix Version/sRelease 6.1.0
ComponentsAndroid, iOS
Labelsn/a
ReporterHans Knöchel
AssigneeHans Knöchel
Created2017-01-10T09:13:45.000+0000
Updated2019-11-21T18:46:51.000+0000

Description

In TIMOB-23327 (iOS) and TIMOB-23186 (Android) we added support for blacklisting URL's to fit some special use-cases using the onStopBlacklistedUrl url together with the blacklistedUrls property. While the changes work fine, the event does not our common event naming and causing some trouble when being assigned to Alloy (e.g. onOnstopblacklistedurl="myHandler". Renaming it to blacklisturl would unify the naming and fix the possible Alloy issues.

Comments

  1. Hans Knöchel 2017-01-10

    Putting in review for [~vijaysingh] (iOS), [~gmathews] (Android) and [~ewieber] (QE)
  2. Vijay Singh 2017-01-10

    PR: https://github.com/appcelerator/titanium_mobile/pull/8736 Test code-
       var win = Ti.UI.createWindow({
           backgroundColor : 'black',
           layout : 'vertical'
       });
       var webview = Titanium.UI.createWebView({
           url : 'https://developer.apple.com/library/'
       });
        
        webview.setBlacklistedURLs(['library']);
        
       webview.addEventListener('load', function(e) {
           Ti.API.warn("load = e.url=" + e.url);
       });
        
       webview.addEventListener('blacklisturl', function(e) {
               Ti.API.info(e);
       });
        
       win.add(webview);
       win.open();
       
  3. Vijay Singh 2017-01-10

    Working fine in iOS.
  4. Lokesh Choudhary 2017-02-13

    Works as expected on both android & IOS. The blacklisturl event is fired successfully when a url is blocked. Closing. Appc Studio : 4.8.1.201612050850 SDK Version : 6.1.0.v20170213093116 Mac OS Version : 10.12.2 Xcode Version : Xcode 8.2.1 Build version 8C1002 Appc CLI AND Appc NPM : {"NPM":"4.2.9-1","CLI":"6.1.0"} Ti CLI : 5.0.11 Alloy : 1.9.5 Node : v4.6.0 Device: running 7.1.1Pixel IOS simulator: iphone 7 IOS 10.2

JSON Source