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
Trusted Contributor
basitj
Posts: 103
Registered: ‎04-08-2011
My Device: BlackBerry Q10
My Carrier: Mobilink

Re: BB10 local:/// not working after OS update

And while we're at it, this thing looks broken too:

 

http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/lt-Select-gt-Drop-down-onSelecte...

Get Speedometer on your phone. http://www.speedometer.mobi
Please use plain text.
BlackBerry Development Advisor (Retired)
erikjohnzon
Posts: 245
Registered: ‎09-21-2012
My Device: Q10
My Carrier: Virgin

Re: BB10 local:/// not working after OS update

Let's focus on the first one to get things sorted out.

 

Yes, Nukul I was able to load a local:/// page havin access uri="*".

 

Basitj: There are a couple things you can check out because nothing happens is not something we can particularily help with.

 

- If you open Web Inspector do you see any errors on the Javascript console?

- If there is no pop-up saying that the access is blocked, then it is *probably* not a whitelisting issue, which would mean it's strange it all of a sudden stopped working.

 

Feel free to send me a zip/bar file I can try out. I'll try and help you work through things. I see that your main page in your config file is a local page, so I'm wondering how this could be an issue, but there are probably some gaps in my understanding.

@erikjohnzon
erjohnson@blackberry.com
Please use plain text.
BlackBerry Development Advisor
Nukul
Posts: 115
Registered: ‎06-06-2011
My Device: 9800
My Carrier: Rogers

Re: BB10 local:/// not working after OS update

Erik,

 

Different webkit rules apply for loading a page (main load) and loading a resource.

We know we can navigate to a local:/// page but I bet if you made a xhr or resource load it won't work because there was a security bug fix that no longer allows non main loads to file.

 

Test case to try is load a local:/// resource from a remote page.

 

 

@nukulb
Please use plain text.
Trusted Contributor
basitj
Posts: 103
Registered: ‎04-08-2011
My Device: BlackBerry Q10
My Carrier: Mobilink

Re: BB10 local:/// not working after OS update

This is crazy, it is something to do with whitelisting.

 

 

The console says:

 

 

Not allowed to load local resource: local:///youtubelauncher.html?ur=http://www.youtube.com/watch?v=vyxpgMdDSVc

 

 

Is that because of the url parameter?

Get Speedometer on your phone. http://www.speedometer.mobi
Please use plain text.
Trusted Contributor
basitj
Posts: 103
Registered: ‎04-08-2011
My Device: BlackBerry Q10
My Carrier: Mobilink

Re: BB10 local:/// not working after OS update

I have only following access tags in config.xml and in exact given format below.

 

   <!-- Expose access to all URIs, including the file and http protocols -->
  <access subdomains="true" uri="*" />
   
  <!-- Cordova API -->
  <access subdomains="true" uri="file:///store/home" />
  <access subdomains="true" uri="file:///SDCard" />

 

Get Speedometer on your phone. http://www.speedometer.mobi
Please use plain text.
BlackBerry Development Advisor (Retired)
jeffheifetz
Posts: 518
Registered: ‎07-18-2011
My Device: Bold
My Carrier: Rogers

Re: BB10 local:/// not working after OS update

Hi 



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)
Please use plain text.
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: BB10 local:/// not working after OS update

This may be a dumb idea but try it

 

Don't use localhost:// - just redirect from where you are

 

I see this happen constantly in 'normal' webdev

 

Typically what occurs is that you reference /<blah>/fred.ext

 

This is an absolute reference

 

Drop the / at the front of <blah> and you're using RELATIVE URLs

 

For example....

 

<script type="text/javascript" src="script/jquery.js"></script>

is completely different to...

 

<script type="text/javascript" src="/script/jquery.js"></script>

It'll fing the first without any issyes - the second can be iffy (to say the least)

 

Take your HTML - dump it all in the root then reference from there

 

There are caveats with CSS




Click the like button if you find my posts useful!
Please use plain text.
Trusted Contributor
basitj
Posts: 103
Registered: ‎04-08-2011
My Device: BlackBerry Q10
My Carrier: Mobilink

Re: BB10 local:/// not working after OS update

Thanks Jeff, Nukul and Erik. Jeff's right. Adding an explicit access tag with my website's root helped. Just to explicitly let every one know, all following scenarios are successfully redirecting back to my local webworks pages when directed from exter pages (hosted on external webserver).

 

window.locat = 'local.///whatever.html'       works

 

clicking on   <a href='local:///whatever.html' >LINK</>  Works

 

Even having content in other tags embedded like images work too. I have this <img src='local:///myimg.jpg' /> works too.

 

Thanks again folks.

 

Now let's get back to my other question in this post: http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/lt-Select-gt-Drop-down-onSelecte...

 

Get Speedometer on your phone. http://www.speedometer.mobi
Please use plain text.
New Contributor
rakesh_katkam2012
Posts: 6
Registered: ‎11-28-2012
My Device: Torch 9800
My Carrier: Docomo

Re: BB10 local:/// not working after OS update

[ Edited ]

Hi,

 

This is not working from me. :smileysad:

Though i have explicitly whitelisted that domain in config.xml, still it is not redirecting from server page to local page.

i have used this function to redirect

window.location = "local:///index.html";

 

I am using BB10 device

Please use plain text.