Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Contributor
Posts: 13
Registered: ‎07-17-2013
My Device: Z10
My Carrier: Rogers

JS Popup: Access to URL Not Allowed

[ Edited ]

I've converted my HTML5 app to a BB10 app following the instructions here:

https://developer.blackberry.com/html5/documentation/webworks_testing.html

 

And successfully deployed my BB10 app to my BB Z10 device using debug tokens and following the instructions here:

https://developer.blackberry.com/html5/documentation/running_your_bb10_app_2008471_11.html

 

But I'm still running into the same JS popup every time I open the app, as discussed in this thread:

http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/JavaScript-Alert-URL-not-allowed...

 

There's not a solution posted in that thread, so does anyone know what this popup means? I'm using a Tomcat web server hosted on my PC, so I've added this line in my config.xml file:

<access uri="http://<my ip address>/<my web server port number>/" subdomains="true">
</access>

 

Still, I find a JS alert saying 'Access to "http://<my ip address>/<my web server port number>/<my web service>/static/home.html" not allowed'.

Retired
Posts: 165
Registered: ‎09-24-2012
My Device: Passport
My Carrier: Bell

Re: JS Popup: Access to URL Not Allowed

Hi cameronjohnston,

 

Maybe you have a typo in your request, but your webserver IP should follow a colon, not a slash, as such:

 

<access uri="http://<my ip address>:<my web server port number>" subdomains="true"></access>

//example 
<access uri="http://192.168.11.11:8080" subdomains="true"></access>

Regards,

A.

Contributor
Posts: 13
Registered: ‎07-17-2013
My Device: Z10
My Carrier: Rogers

Re: JS Popup: Access to URL Not Allowed

[ Edited ]

Hi Anzor,
Thanks for the reply. I realize my typo in that line of my config.xml file. I've changed it to a colon as you suggested, but it still hasn't fixed the problem. I've also added this line to my config file, within the <feature id="blackberry.app"/> header:
<param name="websecurity" value="disable" />

So it seems like the restriction isn't coming from the BlackBerry, and I need to spend some more time looking into my Tomcat web server's security settings.

Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: JS Popup: Access to URL Not Allowed

[ Edited ]

Just a quick suggestion, I don't believe the port is required in the <access> element. If you update the uri to just http://123.456.789.0 (replacing with your own IP address), does that affect anything?

 

If you can provide a screenshot of the full error, that would be ideal too.

 

Edit: I was incorrect. If the port is non-standard, it should be included in the <access> whitelist.


Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.