I'm building an application which contains a WKWebView and trying to detect when the user navigates between pages. The WKNavigationDelegate works fine for plain old HTML sites with links, but fancy new Angular/React sites slip right past it. Is there any way to detect this?
Related
Can we open an ios WebView page from HTML5 using javascript?
I have to redirect to the native ios page from the javascript code on a button click. Is this possible?
I have gone through some links as mentioned below,
How to open a native iOS app from a web app
http://blog.grio.com/2012/07/uiwebview-javascript-to-objective-c-communication.html
But, am not pretty clear with the solutions.
Please help me with your answers and with some proper links.
As you are able to receive/send messages from and to JS. I hope you have UIWebView is added as subview in one of your viewController's view(self.view). Pass the Java script message to your ViewContoller do action here. take for an example you want to present you do it from here.
I am working on windows phone 8 book reader application, i am showing my all html pages on a web browser control, so now when i page change by click next button it suddenly change the page and navigate to another page. I want page should flip like a real book page. If anything required for the answer please let me know, but help me in this.
If you are using a browser control the behavior is gonna be exactly as the website and you can't change it. but you can get a flip affect by using native windows8 xaml. Take a look at this:
http://msdn.microsoft.com/en-us/magazine/cc507644.aspx
I have two different questions I would like to ask. I am new to javascript and I am trying to create a project ... of some sort.
Firstly, is it possible to have an integrated webbrowser within ... say a PHP page? e.g. using javascript, I have a canvas sized 500 x 700 within my "index.php" page, and can navigate to any website while remaining on my "index.php", but the websites appearing on that canvas?
If this is not possible, then is it possible to navigate to a website, and then interact with the elements thereof? I doubt this because you would no longer be connected to your file if you rediirect to another website, hence the integrated idea.
If neither or those are a possibility, then is it at all possible to interact with an EXTERNAL website's elements? External being not yours in this context.
You can use an iframe tag to load an external page, however
With most modern browsers you're not allowed to interact with the elements for security reasons
Many sites (still for security reasons) don't want to be loaded inside an iframe and they try to either escape the iframe or just render back a blank page instead.
One security problem is that a malicious page could open an iframe with e.g. a buy page of amazon.com and then render over it another opaque element that lets the click go through it.
This way a user may be tricked into click over a "watch the cute kitties" button and instead is clicking on the one-click-buy button of amazon (or liking a facebook page, or starting following a spammer on twitter or ...).
This has a lot to do with my previous question:
detecting UIWebView with Javascript
I would like to force a link on my webpage to be opened with iPhones actual Safari Browser, and not in a UIWebView window, even if the app it's being viewed in tried to open all links in a UIWebView window to prevent users from going out of it.
Please note that this is not a duplicate as I'm trying to do this with Javascript/Client-side, not within my own native app (I own the page that's being viewed, but can't control which app is used to view it).
I do not think this is possible. I set up one of my apps to use a UIWebView only and never open Sarfari (though admittedly I allowed only pages within a certain domain).
I'm writing an AJAX application so every link on my page is a javascript link (href="javascript:void(blahblah)"). Some of them opens small webpages in an iframe in a boxed, absolutely positioned div element (that can be dragged around).
This looks nice but if the user middle click on the link he can't open the page in a new tab, because the browser tries to execute the script on a new page which fails.
So what I want to do is:
If the user clicks on the link it opens a webpage in an iframe in an absolutely positioned div. (this works currently).
If the user middle clicks these links (or somehow opens the link in a new tab/window etc.) the page should load in the new tab/window as expected.
Optional: middle click should do nothing on all other javascript links.
Is there a (preferably cross browser) way to accomplish this?
EDIT: this web app is a browser game which uses the canvas element to render the game world, so I don't mind if your solution works only in canvas-capable browsers.
Is there a (preferably cross browser) way to accomplish this?
Yes, don't do href="javascript:void(blahblah)", build on things that work.
Check out the hijax technique, which allows you to progressively enhance your application to use either regular or JavaScript links. There's an hijax jQuery plugin that can help.