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
tomitzel
Posts: 17
Registered: ‎01-04-2013
My Device: Curve 8900

JavaScript Alert URL not allowed

Hello,

 

I use an api from http://api.idlight.net/lookup via AJAX, but in the simulator I get the javascript alert that I don't have access to that URL, although in the config.xml I've tried all variants of the access tag:

<access uri="http://api.idlight.net/lookup" subdomains="true" />

or

<access uri="http://api.idlight.net/" subdomains="true" />

or

<access uri="http://idlight.net" subdomains="true" />

 

But I still get that error, any ideas why?

Please use plain text.
Retired
erikjohnzon
Posts: 245
Registered: ‎09-21-2012
My Device: Q10

Re: JavaScript Alert URL not allowed

What is the exact alert? Is that webpage trying to load other resources as a cross domain request?

 

You are correct in your whitelisting logic as far as I can see.

@erikjohnzon
erjohnson@blackberry.com
Please use plain text.
Contributor
tomitzel
Posts: 17
Registered: ‎01-04-2013
My Device: Curve 8900

Re: JavaScript Alert URL not allowed

It says:

Access to "http://api.idlight.net/lookup?q=test@test.com&key=kjgkdj4565kjbjh" not allowed.

 

 

I am trying to get some information from that api via a GET

Please use plain text.
Retired
erikjohnzon
Posts: 245
Registered: ‎09-21-2012
My Device: Q10

Re: JavaScript Alert URL not allowed

Scary, can you send me your config file by email? You are just doing a get from the webpage to that URL?

 

@erikjohnzon
erjohnson@blackberry.com
Please use plain text.
Contributor
tomitzel
Posts: 17
Registered: ‎01-04-2013
My Device: Curve 8900

Re: JavaScript Alert URL not allowed

Email sent, thanks.

Please use plain text.
Retired
erikjohnzon
Posts: 245
Registered: ‎09-21-2012
My Device: Q10

Re: JavaScript Alert URL not allowed

The problem is the query contains the "@" symbol which is not a valid URI character. It should be % encoded. It should work otherwise :smileyhappy:.

@erikjohnzon
erjohnson@blackberry.com
Please use plain text.
Contributor
tomitzel
Posts: 17
Registered: ‎01-04-2013
My Device: Curve 8900

Re: JavaScript Alert URL not allowed

Great, thanks!

Please use plain text.
Contributor
tomitzel
Posts: 17
Registered: ‎01-04-2013
My Device: Curve 8900

Re: JavaScript Alert URL not allowed

Unfortunately, it does work even after I've encoded the charachter @ :smileysad:

I get:

Access to "http://api.idlight.net/lookup?q=test%40test.com&key=kjgkdj4565kjbjh" not allowed.
Please use plain text.
Contributor
cameronjohnston
Posts: 13
Registered: ‎07-17-2013
My Device: Z10

Re: JavaScript Alert URL not allowed

Hello,

 

I see it's been a few months since this thread was active. I'm running into the same popup message with an application I've deployed to my BB, in debug mode, using BB WebWorks. I'm trying to read from a Tomcat web server, which I have full control over. I believe I've done everything right to configure my web server to allow the BB device access.

 

Was this problem ever solved? And if so, how?

 

Thanks,

Cameron

Please use plain text.
BlackBerry Development Advisor
chadtatro
Posts: 620
Registered: ‎10-01-2009
My Device: Z10

Re: JavaScript Alert URL not allowed

Hello,

 

As a last resort, I'd recommend trying to disable all web security in your application. You can do this via the config.xml like so..

 

    <feature id="blackberry.app" >
        <param name="websecurity" value="disable" />
    </feature>

 

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Please use plain text.