Patch Browser Gesture Click Open in New Card

From WebOS Internals
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.


Introduction

This patch allows you to Gesture-tap in the browser (place your thumb in the gesture area and tap on a link) to open the link in a new card. It's very intuitive and sort of like middle-clicking a link in the browser on your computer.

Patch Source (gestureclicknewcard.patch)

<source lang="diff"> --- .orig/usr/palm/applications/com.palm.app.browser/app/controllers/page-assistant.js +++ /usr/palm/applications/com.palm.app.browser/app/controllers/page-assistant.js @@ -621,7 +621,15 @@

		tapPt.left = event.centerX - tapPt.left;
		tapPt.top  = event.centerY - tapPt.top;

- if (event.altKey) { + if (event.metaKey) { + var urlInfo = {}; + var urlInspectResponse = function(response) { + urlInfo = response || {}; + this._newBrowserPage(urlInfo.url); + }.bind(this); + this._webView.mojo.inspectUrlAtPoint(tapPt.left, tapPt.top, urlInspectResponse); + } + else if (event.altKey) {

			var popupItems = [
				{label: $L('Open In New Card'), command:'openNew'},

--- .orig/usr/palm/frameworks/mojo/builtins/palmInitFramework338.js +++ /usr/palm/frameworks/mojo/builtins/palmInitFramework338.js @@ -28127,7 +28127,7 @@

this._addElementHighlight(event.centerX,event.centerY);
}

-if(event.altKey){ +if(event.altKey || event.metaKey){


</source>