Is Opera on mobile iOS8 using WKWebView or UIWebView? - mobile

After exhaustive search on Google I can't confirm whether they have upgraded Opera to use WKWebView or not?
Can anyone provide a link confirming it.
Thanks

Apparently there is simple trick to determine it.
Previous to iOS8 every phone browser used UIWebView, UIWebView doesn't support indexedDB inherently. So a simple check for indexedDB will solve the need to check for WKWebView.
Code for test :
if (window.indexedDB === undefined) {
console.log('UIWebView still in use');
} else {
console.log('Browser has switched to WKWebView. Hurray!!');
}
One can go for other attribute also. I just described one possible way.
Cheers

Related

Codename One How to disable cookies in BrowserComponent

I have added a payment method (called fawry) in my app by using HTML code in browser component and all things are working fine in simulator but when testing that on a real device, i faced this problem:
How I can fix this problem?
It looks like Google changed the way cookies are handled in the WebView in newer versions according to this answer: https://stackoverflow.com/a/47868677/756809
I made a fix for this so cookies will be on by default in this commit: https://github.com/codenameone/CodenameOne/commit/7d65d9ee0e20035b6d86807ec1cb1bfc077446af

What is the best option to create share button? (react)

I saw a lot of option in order to create share interaction with users:
Web share API: https://www.w3.org/TR/web-share/#sharedata-dictionary
It seems compatible with Progressive-Web-App, but it's not well supported by firefox (https://developer.mozilla.org/en-US/docs/Web/API/Navigator/share#browser_compatibility)
Simple Sharer: https://reactjsexample.com/a-javascript-framework-to-share-url-to-social-media-sites-like-facebook-twitter-reddit-whastapp/
If I understood well, it doesn't work for mobile, am I right?
react-share: https://reactjsexample.com/social-media-share-buttons-and-share-counts-for-react/
Seems to work on every browser, but I don't know if it's PWA-friendly. Seems to be the best option, but I'm not sure... The last update was 1 year ago (https://www.npmjs.com/package/react-share) so maybe it will not be maintained through times...
What do you use for your app? What do you recommand?
Do you know better alternatives?
My need for the App is to share URL through social media or mail/text or ??? etc. No file in theory. And I'd like to have adapted preview on social media when the user share something.
I have used react-share personally and it was unable to open some of the apps in mobile like whatsapp, etc.
The workaround is deep-links.
if user is using a smartphone or a tablet (we can easily get this using navigator.userAgent) then you can use the app based deep-links otherwise the traditional way in which you can redirect user to a new web page.
Some of the examples:
Whatsapp: https://faq.whatsapp.com/563219570998715/?locale=en_US
Instagram: Answer is already given here
NOTE: deep-link works if the user has installed the application on desktop as well (never tried for macOS but for windows and ubuntu it works)
After edit:
You can use emailto: in href while writing <a .../>.
example:
Share this link
For more reference about mailto please visit this MDN doc: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href

Guides on how to make a m.domain website (adaptive)

I have been trying to find guides on how to make an adaptive (I think that's what it's called) website like m.domain.com. However, all I can find on google are design blogs showing the pros and cons of responsive vs adaptive.
I'm guessing you have to use JavaScript to detect the device or browser of the client, and redirect to a mobile site.
I'f any of you guys know the piece of code i will need to detect and redirect (if that's what you have to do) or a guide to building a mobile site like this, it would be much appreciated!
Thanks in advance!
I found the answer myself.
Using:
<script>
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)){
if(document.URL !="http://emilostervig.dk")
{
window.location ="http://google.dk";
}
}
</script>
You can redirect to a different site if the user in on a mobile device.

AngularJS app is not loading on Safari (iOS 5.1.1) back button. Any suggestions?

I've ran into an issue with Safari on iOS 5.1.1 and Angular where I am doing paginated results. After I decide to leave the page that is hosting the app, and then come back to the page by using the browser's history back button.
The application is not initialized so as I scroll again, the pagination functionality is not triggered.
Since 5.1.1 doesn't provide a web inspector, I had to rely on console.log to print events that I want to see that it's executing. On initial load, I see everything ok, but when I am back through the back button nothing fires.
My usual ways of fixing this are not working. Here are the things I've tried:
Used manual bootstrapping of Angular app
Made the page not support caching and expire the page as soon as it's rendered.
Neither of these helped, which is why I am here asking for some suggestions. Unfortunately it's not a very easy thing to replicate through a Fiddle or a hosted HTML file so I am unable to provide one. Hoping that some of you may have experienced this before.
Thanks in advance for any help.
Answer is quite late and I hope you found a solution already but it might be useful for others.
Unfortunately I won't be able to answer why the app is not initialized (due to the lack of code) but I can give you some tools/tips to ease the debugging (assuming you have the iOS simulator).
Debuging on mobile safari can be done either :
with weinre and get the features of the web concole,
or by enabling remote debugging in Mobile Safari itself, see here
Yea, same problem here with iOS 7. It must send the DOM structure over before running any javascript. Kinda pointless...
Since the problem is with mobile safari and since it supports popstate event, you can use this event to detect when the user is back in combination with $location.path(), for example:
$(window).bind("popstate", function () {
alert(location.pathname + $location.path());
});

IBM worklight and Dojo mobile

I am new to IBM worklight.I have created a application using Dojo mobile,Dragged and dropped the widgets into Rich Page Editor but when I run the app or check the result in preview,the widgets are not getting displayed
Technically it shouldn't create any issue unless until something goes wrong, try to open the browser console, there must be something fishy which creating the issue.
If possible share the code to debug the issue otherwise it's tough to provide any pointers without having use case.
Open your mobile app in a JavaScript Debug Environment (Firebug) and look for errors!!!
It could also be possible that the dojo.parser is not running. You can trigger that manually by doing the following:
Configure your application that dojo-parser wont get invoked automatically.
<script type="text/javascript" src="dojo/dojo.js"
data-dojo-config="parseOnLoad: false">
</script>
Trigger parser after dom-ready event got fired.
require(["dojo/parser", "dojo/ready"], function(parser, ready){
ready(function(){
parser.parse();
});
});
In dojo, it won't render in the preview (not correctly if it does). Try to download the Android SDK and run it on the emulator. I have had the same issue with the browser simulator and Dojo mobile in a few apps. I don't use it often, but I haven seen the issue.

Resources