How to differentiate QT WebKit user agent string from mainstream browsers? - user-agent

I have a desktop app that uses QT WebKit, and it requires a different logic in my server application than other browsers (I won't go into details). What's the best way to parse the user agent string & determine whether it is QT WebKit or not?

Related

Electron js: development differences between windows and mac

Context:
I'm starting to implement a cross-platform app for Windows and Mac with electron Js.
The bundle that will use or use this electron Js app is developed in Angular.
My questions are:
Are there differences when developing the app for windows and mac?
Differences in, for example, how it is handled at the code level:
Native menus.
Notifications.
System app events: Minimize, maximize, close.
Running the app in background.
If there are differences, should I indicate them at the code level or Electron Js take care of translating this to each system and I just develop generically without worrying about it?
If I have to indicate at the code level, should I have two projects or can I indicate in the same project that and when something is used for Windows and for Mac?
Electron is designed to be cross OS compatible.
There should be no difference between building an Electron application for Windows, MacOS or Linux.
Implementing the use of native menus, notifications, system app events (minimize, maximize, close), etc with Electron's API's will ensure your application is cross OS compatible.
Some features of Electron modules may be particular to only a certain OS but these are clearly defined and explained within Electron's Docs and API. EG: The movable option when creating a new window new BrowserWindow({movable: true}) can only be implemented on MacOS and Window, not Linux.
As Node.js is bundled with Electron, you will need to be mindful on how you implement some Node functions. EG: Directory separators will be different between Operating Systems so using methods such as path.join([...paths]) would be prudent to make you code cross OS compatible.
As Chromium is also bundled with Electron, keep in mind your use of any particularly new HTML features. Ensure you are not trying to use cutting edge HTML features which have not made it to the version of Chromium you are using within your version of Electron.
Lastly, Angular is a front end framework, this will not be affected by the type of OS used.
In summary, one code base, designed and coded well, will work without issue on Windows, MacOS or Linux.

WebBrowser Component for Mac

I am looking for some web-browser control for Mac, which is the root of my project and any programming language which supports browser can be used for development,
I tried Mono but that does not support Browser control for Mac.
I am completely new to Mac-world, if there is anyone can show me a list of possibilities.
If you’re developing for Mac OS X, you should use Cocoa, the Objective-C framework developed, published, and supported by Apple.
For the Web browser component, you can use the WebKit.
Qt includes WebKit component. Usually Qt apps are developed with C++ in "Qt Creator" IDE. But Qt's WebKit implementation has several ugly bugs. Other WebKit implementations are better, but I don't know if they are available on Mac.
It is also possible to use Gecko XUL. But it looks more complex to me than Qt.

Can I create a cross platform application with HTML5?

I have to target Windows, MacOS, iOS and Android. My plan was to create separate applications for each platform.
However, I am now considering making an HTML5 website (that has different presentations based upon the device being used).
I can create a wrapper for each platform. Windows can include a Webkit control, iOS will have Safari, etc...
The wrapper will load the HTML5 pages into the browser and negotiate input/output for persistance. I can use WebSockets for communication with the outside world (ie. my server).
What am I missing here? What else would be required and what would be the obstacles I would have to overcome?
Best option for making cross platform applications is PhoneGap.
In PhoneGap you write HTML5 and JS code, it provides access of native APIs using JS code and allows you to compile your application and submit to different App stores.
http://www.phonegap.com

Cross-platform HTML application options

I'd like to develop a stand-alone desktop application targeting Windows (XP through 7) and Mac (Tiger through Snow Leopard), and if possible iPhone and Android. In order to make it all work with as much common code as possible (and because it's the only thing I'm good at), I'd like to handle the main logic with HTML and JS. Using Adobe AIR is a possibility. And I think I can do this with various application wrappers, using .NET for Windows XP, Objective C for iPhone, Java for Android and native "widget" platform support for Mac and Windows Vista & 7 (though I'd like to keep the widget in the foreground, so the Mac dashboard isn't ideal). Does anyone have any suggestions on where to start? The two sticking points are:
I'll certainly need some form of persistent storage (cookies perhaps) to keep state between sessions
I'll also probably need access to remote data files, so if I use AJAX and the hosting HTML file resides on the device, it will need to be able to do cross-domain requests. I've done this on the iPhone without any problems, but I'd be surprised if this were possible on other platforms.
For me, Android and iPhone will be the easiest to handle, and it looks like I can use Adobe AIR to handle the rest. But I wanted to know if there are any other alternatives. Does anyone have any suggesions?
You might be interested in Appcelerator's Titanium. It's an alternative to Adobe AIR that lets you build native mobile and desktop apps using HTML and JS (with the WebKit rendering engine, so you can take full advantage of HTML5 and CSS3). It also satisfies your two sticking points:
SQLite is available for persistence storage.
There are no restrictions on cross-domain requests.
I used Titanium Desktop for a recent project and it was a relatively smooth development process. It's also open source so you have access to the full application at all times.
Check it out and let me know if it works for you.
You can create a desktop application with HTML, CSS & Javascript using either of the following two frameworks
TideSDK
AppJS
For mobile you can use the similar HTML and Javascript using PhoneGap

How to embed a web browser control in a cross-platform application?

I need to write quickly this application: a simple window that wraps
a web browser control, that runs html pages.
The Browser UI (e.g. Navigation buttons) should be suppressed.
As a .net developer, I would embed the WebBrowser OCX in a Windows Form.
But this has to run on Mac as well!
I found the following cross-platform candidates.
Which one would you choose (in terms of simplicity, stableness, community support, etc.):
wxWidgets: http://www.kirix.com/labs/wxwebconnect.html
QT: http://www.youtube.com/watch?v=Ee8eRwjbcFk&feature=related
MONO: http://www.mono-project.com/WebBrowser
Why not to use embedded Webkit?
QtWebkit:
The Qt port of WebKit currently compiles and runs on Linux (including Maemo), Windows, Mac OS X and Symbian.
Click here for build instructions.
A very simple test browser is built along with the port.
Since you have (assumption made from your post) .Net experience I'd go with Mono.
Have you considered Adobe AIR?
http://www.adobe.com/products/air/
Mono is probably the best choice if you're primarily a .NET developer and don't care very much about making a well-integrated Mac app (one that behaves like a Mac app in all the many ways Mac users expect). Given your problem space, that sounds like where you are. That said, pay special attention to this limitation from the WebBrowser page if it applies to your problem:
The Mono Webbrowser currently lacks
support for window.external, the
bridge that allows Javascript code
embedded in the browser to communicate
with the managed world using the
ObjectForScripting.
QT is very well established, and a great platform if you want to develop this in C++. Remember that there are licensing fees if this is a commercial app.
I've played a bit with wxWidgets. It's big advantage here is that it's probably going to be the smallest distribution, since you only have to include what you need. If all you need is the web browser, I'd look at this, but in my experience it's hard to make wxWidgets programs look good or act correctly on Mac (or on Windows for that matter).
Another option may be to write it as a Java app using the Eclipse Standard Widget Toolkit. This includes a browser control that embeds IE, Safari or Firefox, depending on the current platform, and generally behaves well on OS X.

Resources