Help get this topic noticed by sharing it on
Twitter,
Facebook, or email.
Twitter,
Facebook, or email.
appAPI.openURL in Firefox not always working
I've noticed some flakiness/intermittency with "appAPI.openURL" on Firefox, when I call this method from background.js. It is rock solid on Chrome and IE. But on Firefox, it seems to not work (it does nothing, and returns no value) some of the time. What might this be?
-
Hey Bryan,
There are no any known issues with appAPI.openURL but we will check and let you know if we find anything (or if we will need any further information from you) -
-
Hello Bryan,
Please can you provide the snippet of code you are using and let me know which operating system you are experiencing this on. -
-
In background.js:
appAPI.openURL({
url: continuation_url,
where: "current"
});
and "continuation_url" is a perfectly valid https:// url.
Without going into too much detail - one code path which leads here, works, while another one doesn't. Reliably and reproducibly. The url is valid in both cases. And this is only in Firefox. On Chrome and IE it's all fine.
Is there some other log I can look at which might give more details as to why it's failing? I see nothing in the console, it just doesn't do anything. -
-
Hello Bryan,
I'm have tested this with the following code running for an extended period of time, and it works every time.appAPI.ready(function($) {
var i=0;
setInterval(function() {
if (i++ %2) {
console.log('Opening Google URL');
appAPI.openURL({url:'http://google.com', where:'current'});
} else {
console.log('Opening Example URL');
appAPI.openURL({url:'http://example.com', where:'current'});
}
}, 5000);
});
In order to assist further I need to take a closer look at the extension.
Therefore, please provide as much of the following information as possible and I will investigate:
- The extension id
- The file/line number where the code snippet can be found
- Which browser and operating system you are testing on, including version numbers
- The exact steps for reproducing the problem
- Any additional useful data, such as URLs, screenshots, videos, ...
-
-
There is some kind of cachy thing going on. Only in Firefox. And possibly it's only happening on my site, and not on your test code's sites (google.com and example.com).
I am now running urls through this function before calling appAPI.openURL, and now I seem to be making progress:
function cache_bust(url) {
if (url.indexOf("#", url.length - 1) !== -1) {
url = url.substring(0, url.length - 1);
}
if (url.indexOf("?") == -1) {
url += "?";
} else {
url += "&";
}
url += "rand=" + Math.random();
return url;
}
Without the above function, appAPI.openURL was only working the first time (when loading our own site), and on subsequent loads, the call would succeed but nothing would change in Firefox. -
-
Hello Bryan,
It's possible that FF is not fetching a new version of the page unless the URL has changed, hence when you add the random param it causes FF fetch the updated page.
Can you provide your URL (if you prefer to keep it private please email it to support@crossrider.com) and I will be happy to investigate. -
Loading Profile...




EMPLOYEE
EMPLOYEE
