Although source maps are great for debugging, you don't really need to be sending these files to your end users. jQuery Mobile's source map is huge (222 kb, which is massive for a mobile website). Is there some way of disabling the request to get this map from the server? I have tried using jQuery's CDN and tried using a local include, but in both cases a request is visible in the Network tab of Chrome's DevTools.
Related
I'm building kind of a web browser and I'm using a WKWebView.
Now, I wish service workers were supported by WebKit but unfortunately, that's not the case. So I'd like to build a system that's closed to service workers.
The main thing is : I want previously visited web pages to be displayed in offline mode.
So my main idea would be to extract and store the html, css and js files from the web pages.
The problem is that I have no idea if this is possible or not and I really don't know how I could do what I want to do if it isn't possible.
The Windows run-time API class WebView in Windows Phone 8 was for displaying local HTML content, not web browsing.
Microsoft's Matt Small wrote in Ten things you need to know about WebView that a WebView object is not a general-purpose browser, and apps which display online content in a WebView as their primary purpose will be rejected. Small was writing about Windows 8 Phone in 2012.
Has that position changed for WebView objects in UWP apps in 2016? The Windows 10 XAML documentation itself suggests using the http or https schemes for remote content, and the ms-appx-web scheme for local content.
The WP8 WebBrowser class looked promising, but doesn't seem to be in W10M.
If WebViews are not permitted to browse the web, are there any other objects, frameworks, or projects that would suitable for displaying web content as their primary purpose in UWP apps? Ideally, something that runs JavaScript and functions like a real browser.
Can we use a WebView to display remote web content in UWP apps?
Yes you can, it works well, it uses Edge engine and runs javascript and everything like a real browser.
It was on news few months ago that Microsoft’s Edge team is encouraging developers to build browsers. You can also take a look at the JSBrowser app, it is a simple web browser written in javascript and uses the WebView control.
However, even though it works well, it is still not perfect, it has problems like memory management issues and limited access to the web content through app but it is good enough to be used as an in-app browser (I'm doing so in a live app).
If WebViews are not permitted to browse the web, are there any other
objects, frameworks, or projects that would suitable for displaying
web content as their primary purpose in UWP apps? Ideally, something
that runs JavaScript and functions like a real browser.
It is definitely permitted to browser web using WebViews but I have no idea if there is any alternative for WebView in UWP.
I'm working on a web application that uses django.
I would like to create a native application of the site for ios / android using phone gap.
Is this possible? As I understand native devices cannot interpret python code.
It is early in the project and if it proves too difficult I may go with a different framework I.e backbone.js.
Any thoughts / experiences?
That's right, you cannot run python code on iOS or Android using PhoneGap, but there is no need to do that. Yes, you can build a native mobile application of your site using PhoneGap.
I'll try to explain a bit how these technologies compare to each other:
Django is a python web framework running on a web server
PhoneGap is a framework for building native mobile applications using web technologies (HTML5+CSS+Javascript), the application will run on a mobile device
One common approach is to build the mobile UI with i.e. jQuery Mobile and use the Django web application to provide a RESTful API to get data to the application.
Take a look at this another question for more details.
Edit: Answer the question in the first comment
Yes, it's possible to build a fast and well working application with these frameworks. The performance with today's smartphones is more dependent on the quality of the implementation than i.e. jQuery mobile and Django in themselves.
Basically with PhoneGap there are three different ways for showing the content to the user:
server side generated pages
pages generated on the client side with Javascript usin data from the server, transferred in a predefined format using for example JSON
a combination of the previous two
This answer clarifies server-client communication and page rendering quite well.
You could use PhoneGap a bit like a constrained web browser, and basically show content directly from your server as you would when the user accesses the site with a normal web browser. But I don't recommend this, though. This approach has many downsides to it (i.e. what happens when the user opens a link from your website leading to another website?)
To be accurate, at least in my opinion, UI written with Javascript and running inside an app built with PhoneGap is not native. Comparing native applications and PhoneGap applications is another thing, here is one take on explaining the differences.
I don't know what kind of service you are building, but in general I'd suggest evaluating the different approaches before starting to build an application. Would a responsive mobile optimized web site do or is there real need for what an app can provide?
If you decide to build an app with PhoneGap, I'd suggest that you do it with client side Javascript and fetch the data from the Django backend with XHR requests in JSON format. There are lots of examples available in the internet.
We have developed a Web Application using grails, groovy and oracle as database with css and javascript (jquery) and ajax for web related features. The application work fine on all desktop based web browsers like firefox, IE, chrome etc.
And for hosting it we use tomcat server.
Now we want to develop a mobile based version of this web application such that when the request comes from a mobile device the server should detect the type of device and route it or serve it using the appropriate instance (mobile one for mobile device and normal one for computers)
How do I implement this check in request resolution? is this by creating my custom filter in tomcat server?
Also for the mobile instance I want to have the changes only in the views , its should use the same controllers and services and all other code used for the main browsers, just views and styles and js if required will change. how do I go about having different views for mobile version which get called automatically if the request is coming from a mobile device
Thanks
Priyank
Have you tried the spring mobile plugin? The documentation seems to cover all your questions...
This blog post contains specific tips for porting a Grails web app to mobile
My current Intraweb application is actually a DataSnap Client which connect to my DataSnap Server that connects and sits together with an Interbase Server on the same machine. It works correctly but quite slow and require constant Internet connetion to work. Each button clicked or any event triggered will require the browser to connect to the Web Server (Intraweb).
I am thinking of creating an offline web application using Intraweb in Delphi XE2, HTML5 cache manifest feature, and use the browser-based SQL storage (such as webSQL or IndexedDB) as local browser storage when the mobile device goes offline. It will only connect to real DataSnap server when Internet connection is available to do initialization or synchronization back to the DataSnap Server.
Is is possible?
My main problem is to get the webpages' url out from the intraweb web application, and I do not want to put all the browser's storage code inside the template files.
It is also quite tedious to move the JavaScript code generated by Intraweb to other js files, and by doing this I may break the Intraweb application codes and logic. Is there any workaround on this?
As you stated by yourself: "Each button clicked or any event triggered will require the browser to connect to the Web Server".
This is the design of IntraWeb: a Client-Server application, in which most code logic is executed on the server side. You can add some AJAX widgets to your applications, but IntraWeb, by itself, is a Server-Side framework.
In order to have a full HTML5 AJAX Client application able to run stand-alone, you'll need a pure JavaScript application. Even Sacha/ExtJS based AJAX frameworks (like ExtPascal or UniGUI) or Morfik require a server to run.
But creating a pure HTML5 JavaScript application is some difficult task - but it is possible, since you can consume DataSnap content from JavaScript (using XML or JSON). You can try http://www.appcelerator.com/ which is a great IDE and platform for creating JavaScript applications, which run as native apps.
In order to have a disconnected HTML5 application, you may have to wait for the following products to be released:
Smart aka OP4JS;
Elevate Web Builder.
Thanks to these two projects, you would be able to code in object pascal, then the JavaScript will be compiled from the pascal source, then use HTML local storage. See for instance this article about using storage with Smart/OP4JS - I've tested it (in Alpha), and it works very well: you have a pure stand-alone HTML file which is able to run without any server, and have local storage. SQLite3 storage is planned (not yet finished).