Installing and Running WebKit in Linux Using Qt

I’m

coming to appreciate more and more all of the hard work software

developers perform. I wouldn’t consider myself an open source elitist,

but there’s something special about the associated ideologies. When a

large community of people band together to work on a project, a lot of

fantastic products can be created.

One such product is WebKit, the open source Web browser rendering engine used by Safari

(as well as a number of other products). It’s very important to keep in

mind that Safari and WebKit are two very different things. Safari is a

Web browser that uses WebKit as it’s rendering engine.

The WebKit developers put forth the effort to port WebKit to Qt, which is, as stated by the developers:

Qt

is a comprehensive development framework that includes an extensive

array of features, capabilities and tools that enable development of

high-performance, cross-platform rich-client and server-side

applications.

Qt is truly cross-platform and allows deployment on a wide range of

hardware configurations, as opposed to other “cross-platform” products

that are restricted to Windows and Mac OS X. The fact that the WebKit developers put forth the effort of porting to Qt4

gives users the ability to run their rendering engine on any platform.

Thanks to their hard work, it’s quite easy to run a WebKit-based

browser in Linux.

Preparing your Linux system for WebKit

I’d like to be explicit in saying that the following instructions are geared towards a fresh install of Ubuntu 7.04, but should be applicable to a wide variety of Linux distributions. First and foremost you’ll need to add extra repositories. After you have followed those steps we can begin.

There are a number of packages you’ll need to successfully build a Qt4 Web browser that uses WebKit.

sudo apt-get install libqt4-dev libxslt-dev gperf bison libsqlite3-dev flex build-essential subversion

There will be a lot of additional packages to install, so don’t be

surprised if the list of packages for installation is significantly

large.

Obtaining a nightly build of WebKit

Next, we’ll need to use Subversion to check out the WebKit source. The following command will check out files to a folder titled WebKit within your working directory, so be sure your working directory is appropriate (I used my home directory).

svn checkout http://svn.webkit.org/repository/webkit/trunk WebKit

You will be able to monitor the checkout process as each file is listed in your terminal.

The checkout will take some time, as there are quite a few files to

download. When the checkout is complete, you’ll see the following

message:

Building your Qt4 WebKit browser

When the checkout is complete, you can initiate the build of your Qt4 WebKit browser using the following command:

QTDIR=/usr/share/qt4/ WebKit/WebKitTools/Scripts/build-webkit

The script will take a minute to prepare the build, and then the process will begin.

This step can take quite a bit of time depending on your hardware

configuration, so take a few minutes to have a cup of coffee and relax

while your browser is being built. Your terminal will scroll with

hundreds of lines of build commands and more, so don’t feel the need to

sit and watch it build (unless you’re interested — I was).

When your build is complete, you’ll see the following message:

Running the browser

A successful build means you can run your Qt4 WebKit browser using the following command:

WebKit/WebKitBuild/Release/WebKitQt/QtLauncher/QtLauncher about:blank

A very basic browser window will appear with limited controls and an

address bar. There will be some information scrolling in your terminal,

but it can generally be disregarded.

You’ve now got a native WebKit browser to play around with in Linux.

I took a second to attach the launch command to an entry in an panel

using the WebKit icon. It’s more convenient than keeping the command

saved somewhere to copy and paste when I’d like to test in WebKit.

You can also add your WebKit browser as an entry in your Applications menu using the menu editor if you prefer.

Some quirks I’ve come across so far

There are a few things that will appear out of place. First and

foremost, you’ll notice that form inputs will have, what seem to be, a

random background-color. I may be completely mistaken,

but I haven’t looked into things deep enough to find the rhyme or

reason behind the discrepancy. From what I can tell, if the input is styled with CSS, the style takes precedence over any ‘default’ colorization.

The next issue I’ve come across is that you’re not able to work with xHttpRequest.

This is another issue I have not researched in enough detail, but if

anyone has any insight regarding an inability to make use of XHR, I’d be interested in reading about it.

Finally, the only other quirk I’ve come across so far is that you’ll need to include http:// in any URL

you enter in the address bar. While this may seem like a small detail

to write about, after my first successful build I spent a few minutes

thinking that something went wrong.

Things to keep in mind

Perhaps the most important thing to keep in mind is that you’re

running a nightly build of WebKit, not the build Safari is using. The

nightly versions are much more advanced than Safari’s WebKit, so some

of the quirks that appear in Safari may be handled in your Qt4 browser.

Due to the version discrepancy, you can’t depend on a nightly build

of WebKit sufficing for a legitimate test in Safari. It is useful,

however, to take a quick look at overall structural elements of your

designs before making the effort of moving to an OS X machine.

Footnotes and inspiration

I was originally drawn to working with WebKit on Linux by a post on the same subject at as days pass by. I had followed his instructions and ran into a few issues. Going on his advice, I joined #webkit on irc.freenode.net and started discussing a few issues with one of the developers there. He (or she) was extremely helpful in assisting me to successfully build WebKit. I was also directed to a Wiki page which included similar instructions to the post on as days pass by.

I felt compelled to write this post based on specific instructions

surrounding Ubuntu Feisty but would like to give much credit to the

hard work of others.

linux下qt环境的运行,在Linux下使用QT环境来安装和运行WebKit相关推荐

  1. linux下怎样运行oyrhon,Fedora CoreOS基础操作,包括安装并运行Fedora CoreOS

    如果不知从何处入手Fedora CoreOS,那就看看本文,内容有:Fedora CoreOS的理念.入门.创建配置.安装并运行Fedora CoreOS.zincati,rpm-ostree和自动更 ...

  2. 基于PHPEnv的本地环境搭建—PHP第一个项目:HelloWorld(从安装到运行)

    1.安装软件 编程工具:Notepad++ 运行环境:phpEnv 2.用phpEnv建立本地运行环境 (1)官方下载phpEnv,运行phpEnv,启动服务.服务启动之后,apache和mysql变 ...

  3. linux如何运行windows游戏,可运行在Linux下最好Windows软件和游戏

    下面这篇文章是为了告知我们的读者,在Wine软件的帮助下,流行的Windows原生软件和游戏,也可以安装并运行在基于Linux的操作系统上. 我们最近发现,许多人不知道,游戏如流行的魔兽世界,使命召唤 ...

  4. Linux下安装Dubbo运行环境

    Linux下安装Dubbo运行环境 1.1.1    安装jdk zk首先需要安装jdk环境. yum -y install glibc.i686       #jdk依赖glibc mkdir /u ...

  5. C#编写运行在Linux环境下的采用Mediainfo来获取多媒体文件信息的代码

    C#编写运行在Linux环境下的采用Mediainfo来获取多媒体文件信息的代码 原文:C#编写运行在Linux环境下的采用Mediainfo来获取多媒体文件信息的代码 项目开始设计的是运行在wind ...

  6. linux下安装matlab运行环境

    linux下安装matlab运行环境(Disabled - No sandbox or build area path) 由于某些需求需要java中调用matlab算法,需要在linux中安装运行环境 ...

  7. linux qt搜狗输入法用不,Ubuntu14.04下搜狗输入法不支持Qt5环境

    问题环境确认: 系统平台Ubuntu14.04/ 安装了搜狗输入法/ 安装Qt5.4.1 一般自定义下载来Qt软件包,安装之后,都会有这个问题,在Qt环境下或Qt Creator下不能切换输入法,也不 ...

  8. 【夸QT十一】外来物品:通用脚本帮助Web运行基础Linux命令

    需求分析: 需要注意的是在这里第一次,这个人是不是QT系列文章,它是关于Web的,之所以写这篇文章.这是因为碍着Web相关开发时间,而且往往涉及linux与底层指令处理.例如,创建一个文件夹,删除一个 ...

  9. linux系统下经常使用的两种桌面环境,12种最佳Linux桌面环境 | MOS86

    您可以从一英里远处分辨出屏幕快照是Windows还是Mac,这是因为两种商业操作系统都只有一个桌面环境. Windows具有开始菜单和任务栏,而macOS具有其标志性的Dock和菜单栏. 立即解锁&q ...

最新文章

  1. python beautifulsoup4_Python之Beautiful Soup 4使用实例
  2. 在html中显示word,如何在浏览器网页中显示word文件内容
  3. java|jsp类成品展示_jsp学生诚信素质评价系统
  4. 微软Win10最新补丁KB5017380更新了什么?
  5. 英语单词最全的前后缀讲解
  6. android 如何读取u盘中数据恢复,U盘数据恢复
  7. 基于java+springboot+mysql的中小型超市进销存管理系统
  8. java实现基金浮动_Java: 实现自回归分析/线性回归分析/基金各项指标计算等
  9. Cesium学习教程+笔记(Mars3D) 图层 图层组 矢量数据
  10. C++中如何判断一个字符串中包含另一个字符串
  11. 证明残差的平均值等于0,残差以x加权的平均值为0
  12. matlab安装破解
  13. Swagger如何屏蔽某些接口显示
  14. 阿里云oss 收费标准细则,太鸡贼了,不要傻傻的以为只收你存储的钱
  15. 基于python人工智能的最全学习路线总结,思路明朗了学习才高效
  16. 用谷歌云搭建属于你的深度学习工作站
  17. java基于springboot+vue的企业公司员工人事管理系统 nodejs 前后端分离
  18. Elasticsearch(033):es中Document(文档)之删除文档
  19. Fegin远程调用示例实战
  20. 白糖期货基础知识介绍——影响白糖期货价格有哪些因素?

热门文章

  1. 小型网络的组建及排错
  2. Mybatis源码阅读(四):核心接口4.2——Executor(下)
  3. 计算机网络本直通线的制作方法,电脑网络:教你一分钟自制高质量网线(含水晶头分类),不求人...
  4. antd 获取table选中行数据_element-ui 组件el-table默认选中行setCurrentRow采坑记
  5. 四宫格效果 css_【深度教研】智力游戏“九宫格” 集体教研活动纪实
  6. java 实体类规范_实体类的规范
  7. 两个链表求交集_实现两个排序链表的并集和交集
  8. c#读取指定字符后的字符_在C#中读取字符的不同方法
  9. 计算机科学技术专业解析,专业解读—计算机科学与技术
  10. java get post 注解,GET/POST接收或发送数据的问题