Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27913] Android: 'setBlacklistedURLs' does not block URLs

GitHub Issuen/a
TypeBug
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 9.0.0, Release 9.0.2
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterSamir Mohammed
AssigneeUnknown
Created2020-05-29T12:29:23.000+0000
Updated2020-06-01T11:26:09.000+0000

Description

Using the following test case the URL does not get blocked and a log message is not displayed stating the URL has been blocked. When testing on iOS the URL is blocked and the log message can be seen. *Test Case:*

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();

*Expected Result:* URL should be blocked and log message should display a message saying URL has been blocked. *Actual Result:* URL is not blocked and event is not fired.

Comments

  1. Joshua Quick 2020-05-29

    [~smohammed], you passing in "library" and not the full URL. Can you try the below please?
       webview.blacklistedURLs = [
           'https://developer.apple.com/library/',
           'https://developer.apple.com/library'
       ];
       
  2. Samir Mohammed 2020-06-01

    [~jquick] I tried to include the above changes but I still see the same problem.

JSON Source