Custom URL and HTTPS in Windows Phone 8 - windows-phone-8

I'm trying to open my app via a custom URL in WP8. I.E, when a link like "myurl://..." is clicked on the browser, it needs to open my app.
Now, when I try to do it from a HTTP link, it works. But when I try to do that from a HTTPS link, I see my app flashing but not a single line of code is processed (not even the "initializeComponent" function of my MainPage.xaml which is, of what I know, the first function to be called when an app is called. So what really happens ? Is there any way to fix this ?
If it can help, I have an SSL certificate for my https page and it is installed on the phone so I don't think it comes from there...

Related

get method that shows in the google and chrome url

Hi i just installed a chrome in my new development laptop and every time I go to google is does this weird URL from chrome into the url
https://www.google.com.ph/?gfe_rd=cr&ei=OG9OVP7YIOqS8QeN4oCwCQ&gws_rd=ssl
anybody knows what it is and why it is showing up on my development pc I already know its a Get method?
or maybe my pc just got infected with a trojan or virus?
I have never encountered it before is it a crawler or robot
what does it do and will it affect me
Your PC is not infected.
You must be accessing google.com using http://www.google.com, you just need to use HTTPS instead of HTTP.
When you access google.com using HTTP then google redirects you to HTTPS site for google and appends all the information that you are getting in your url.
Hope it helped.
found the solution here

Preventing iframe caching in Chrome

I have an emulator I wrote for testing smart TV web apps. The emulator itself is a web app, with a simple interface that showing a TV and remote, and loads the web app being tested inside an iframe. Users launch the emulator from the command line, which starts up two simple HTTP servers (one for the emulator, one for the web app being tested), then starts up chrome using the --app command line switch pointing it at my emulator.
The problem is that every time Chrome launches, it loads a cached version of the web app. If you made changes to your web app since last launch, they aren't shown until you do a hard refresh of the page.
To get around this, I've tried the following:
Launching Chrome with the addition of the --disable-cache switch
Appending a random query param to the startup URL passed to chrome (ex: --app=http://localhost:6001/?random={some_hash})
Appending a random query param to the web app URL specified in the iframe
None of these seem to do the trick, however. The emulator code doesn't appear to be getting cached as the src URL in the iframe does indeed get a new random value appended to it every time. However, the page loaded in the iframe is old, and always requires an refresh after initial launch.
Any other things I can try that I haven't covered above?
Further example of issue:
User launches emulator for first time for web app 1
Web app 1 shown in emulator
User closes emulator
User launches emulator for web app 2
Web app 1 shown in emulator
In this case, the emulator would launch and still show web app 1. It continues to show web app 1 through refreshes until the user performs a hard refresh (cmd+shift+r), at which point web app 2 finally displays.
It sounds like this might be related to the bug here:
https://code.google.com/p/chromium/issues/detail?id=324102
As a workaround, I found that setting the iframe src from javascript ALONG WITH appending a random query param to the URL seems to do the trick. Simply doing one or the other doesn't work.
Example:
// still loads stale page
document.getElementById('tv-screen').src = 'http://localhost:6001/';
// will load fresh page
document.getElementById('tv-screen').src = 'http://localhost:6001/?rand=' + Math.round(Math.random() * 10000000);

Chrome data compression proxy error

When I use youtube video upload API on mobile phone it uploads the video but before redirect to the redirect_url, most of the times it throws this error:
url with error: http://uploads.gdata.youtube.com/action/FormDataUpload/FSVfvf45g45g4FFDSGSdfgr24g3t34t3EFVFFDSFGgg3435?nexturl=http://my-redirect-url.com:80/uploaded
This page cannot be loaded via the chrome data compression proxy. Try reloading this page.
when I just reload the page it redirects to the right redirect_url and the video is uploaded appropriately.
What might be a solution to fix this error?
I am the tech lead for the Chrome data compression proxy. We happen to have some special case logic to deal with YouTube URLs in the proxy which would cause this, but this seems not to be working as expected. Can you give me an example of your use of the API? Is this a POST request? Seems like something we should be able to fix.
Youtube or Google updated something in apps/youtube_api (unclear what) but when I accesses the app console it was different, then I created a new app and it worked.

Launching Chrome Packaged Web App from Website

I have a Chrome Packaged Web app (which is required as it needs to access the Serial Port), and I'd like to be able to launch it from my website (with some data) when I click on a link/button on that website.
It'd be even better if it could detect if the user wasn't running chrome or didn't have the web app installed and could direct them to the right place...
Are there any examples? It seems like an obvious thing to want to do, but I'm really struggling to find anything...
To launch an app you can use url_handlers, a new feature recently landed (should make Chrome 31). You can pass data in the URL.
You can check if an app is already installed, and initiate the install if not, by using the chrome web store's inline install functionality.
Found a better solution to this problem.
In #Vincent Scheib solution you have to redirect the user to /some/url, or open a new window (that can be actually blocked as popup). All of this it's not so good from an UX aproach.
My solution is to create the app and configure the externally_connectable. You have to pass the url domain of the web site that will try to open the app. For example:
"externally_connectable": {
"matches": ["*://developer.chrome.com/*"]
}
Then, in your packaged app in your background script, you can do something like this:
chrome.runtime.onMessageExternal.addListener(function(message) {
if(message.launch){ //This parameter will be passed in sendMessage method below
chrome.app.window.create("main.html");
}
});
Finally, to trigger the app open you have to send a message using your packaged app id. For example:
chrome.runtime.sendMessage("mdoedhlejmepngilmgoenbhmipoclckb", { launch: true });

Auth redirect - opening a local HTML document in a new tab in a Firefox extension

I am currently trying to port a Chrome extension to Firefox.
The Chrome extension has a "Login" page, which is opened in a new tab as an HTML document. The HTML document is stored in the local directory with other extension files. The user inputs a URL which should represent a server running our application, where the user will be asked to login. After a successful login, the user is redirected back to the options.html page, which is updated to show the user's preferences.
I would like to duplicate this in the Firefox extension, i.e. I would love to avoid writing anything in XUL to build an options page.
I tried opening a new tab with my HTML page like this:
var url = "chrome://myextension/content/options.html";
var win = Components.classes['#mozilla.org/appshell/window-mediator;1']
.getService(Components.interfaces.nsIWindowMediator)
.getMostRecentWindow('navigator:browser');
win.gBrowser.selectedTab = win.gBrowser.addTab(url);
But I don't like this for a few reasons: 1) The navbar in the new tab displays the "chrome:// ..." URL, and 2) it breaks the authentication process. The authentication is done using an OAuth type system, and the current URL is passed into the API so that the user can be redirected back upon successful authentication. The authentication fails with "chrome://" as part of the URL.
Just out of curiosity, I tried hardcoding the URL like this:
http://myextension/content/options.html
And the user is actually successfully authenticated, but then the redirect obviously fails afterward.
The Chrome extension seems to work with no problems or weird hacks. From what I can tell, opening it works like this:
chrome.tabs.create({"url":chrome.extension.getURL("options.html"), "selected":true});
And referencing the URL of the tab later so we can be redirected back to it just works like this:
var options_url = chrome.extension.getURL('options.html');
So, I'm wondering: what is the best way to open a local HTML document in a new tab with a Firefox extension, without using the "chrome://" "protocol"? Is there a similar way to how it can be done with Google Chrome extensions?
UPDATE 23/5/12
So this article says that chrome:// URLs are not accessible from the web, only locally.
http://adblockplus.org/blog/web-pages-accessing-chrome-is-forbidden
I think this could be the reason why my authentication was failing. I'm definitely looking for a way for my extension to display a local HTML file in a window or tab without using chrome://.
UPDATE 07/6/12
Here is my (hopefully temporary) solution:
The user enters the URL of the server running our application. He/she is redirected to the application login page, but instead of passing "chrome://myextension/content/options.html" as the URL to be redirected back to after authentication, I pass a phony URL, i.e. "http://myextension/thisis/madeup.html".
In my extension's overlay.js, I set up an HTTP request listener which listens for the phony URL being requested. When a GET happens for the phony URL, I cancel the request, and open the real, locally stored page at "chrome://myextension/content/options.html".
See the following references:
https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIObserver
https://developer.mozilla.org/en/XUL_School/Intercepting_Page_Loads#HTTP_Observers
If you're trying to do this redirect for an OAuth call you should try using OAuthorizer from Mozilla instead of doing the redirect work yourself. Hope that helps!