webkit

How do you put a normal control into an NSView?

What I'm actually trying to do is put a WebKitView into a ScreenSaver (which inherits NSView). I'm totally new to MacOS X and Cocoa (but I'm very familiar with Objective-C and used some parts of GNUStep). Do I need some laying out? I want to show only one control in the whole NSView. ...

webkit float issue

I have some problem where i set 2 floated div elements, one of div contain select element, when the page loaded the divs didn't have the problem, but as soon i click on of the element(s) on select box, the div that positioned in right shift to bottom? Here some example code about what i'm talking: #div1,#div2{float:left} #div1{width:2...

Any good WebKit wrappers for .Net?

Are there any good (or in active development) WebKit wrappers or ports for .Net? p.s. I am aware of Swift.Net (old and out of date) and GeckoFX (firefox wrapper). ...

Webkit JavaScript Reference

For Gecko there's Mozilla Developer Center For IE there's MSDN. For webkit there's...Apple Developer Connection? There are a couple of JavaScript related documents on ADC, but nothing as comprehensive as MDC or MSDN. There's no reference. There's no way to look up methods of arrays or strings for webkit, or anything is there? So what...

Cocoa - Prevent caching of Javascript in WebKit - Safari Beta 4 bug?

I have a Cocoa app containing a WebView. I'm targeting the 10.4 SDK due to the app's installed customer base. (i.e. I cannot require Leopard.) I have two files: index.html and data.js. At runtime, in response to user input, I write over the data.js file, often, populating it with current data from the app. (The data.js file is used b...

How to get the language-setting of an iPhone OS device visiting a web page?

I'm trying to create a web-page intended to be viewed by an iPhone OS device. Is there a way to retrieve the current language or some locale-specific data when a user visits on an iPhone OS device? I want to set the web-page language according to the local or language of the device. So, how can I get the language-setting of an iPhone OS ...

How can the selection of a textarea be determined/manipulated in Safari from JavaScript?

I have some JavaScript code that does two things: retrieves the selected text from a text area adds a prefix and suffix to that selected text The code currently uses the selectionStart and selectionEnd properties of the textarea to figure out where the selection starts/end, extracts the selection text and processes it, and then re-wr...

Dynamic web pages (Javascript) - monitoring contents from outside

Let's assume I browse a specific web page that uses JavaScript to update its view constantly (using Web 2.0 techniques to talk to their server to retrieve updates of data). Now I like to run some code on my own computer that monitors the contents and alerts me if some specific data appears on the page, so that I could record that data, ...

Proper way of lazy-loading a single select box options via ajax once clicked.

I have a select box that should be populated only when clicked. The query involved takes a long time so I'm deattaching it from the standard data shown on the page. I have implemented the function loadMyData(element, id) which does an ajax request and returns the data as JSON. Then it populates the select box. the event is binded to t...

Disable the text-highlighting magnifier on touch-hold on Mobile Safari / Webkit

I have some elements in my iPhone website that don't have any text in them but require the user to click and hold on them (DIVs). This causes the text-highlighting/editing loop/cursor to show up, which is really distracting. I know there is a CSS rule for removing the black-box that shows up on clickable elements when they are touched....

How to get Javascript in a QWebView to create new instances of C++ based classes?

I've successfully added an C++ object to a QWebFrame with addToJavaScriptWindowObject, and can call a slot on that object from javascript. But what I really want to do is have one of those slots return a new object. For example, I have a slot like this, which returns a QObject derived class instance: MyObject* MyApp::helloWorld() ...

Firing a Keyboard Event in JavaScript

I'm trying to simulate a keyboard event in Safari using JavaScript. I have tried this: var event = document.createEvent("KeyboardEvent"); event.initKeyboardEvent("keypress", true, true, null, false, false, false, false, 115, 0); ...and also this: var event = document.createEvent("UIEvents"); event.initUIEvent("keypress", true, true,...

Is there a built in method to merge the properties of two objects into a single object?

I'm looking for a built-in method that combines two associative arrays or objects into one. Using webkit in Adobe Air if that makes a difference. But basically I have two objects or associative arrays if you will: var obj1 = { prop1: "something", prop2 "anotherthing" }; var obj2 = { prop3: "somethingelse" }; and I want to do merge the...

Is it possible to override document.cookie in WebKit?

In Firefox it's possible using the following... HTMLDocument.prototype.__defineGetter__("cookie",function (){return "foo=bar";}); HTMLDocument.prototype.__defineSetter__("cookie",function (){}); This doesn't cause any errors in WebKit, and WebKit definitely supports __defineGetter__ and __defineSetter__, but it doesn't work. Guessing ...

get viewport position in javascript in iphone safari

Hi everyone, I'm trying to prevent element from scrolling in safari on iphone. I've tried solutions mentioned here: http://stackoverflow.com/questions/777621/iphone-safari-scroll-a-list-inside-a-html-container But my list is large and it doesn't work so smoothly. What I have in mind is to detect onscroll event and reposition the elemen...

Why does this only work in Firefox?

I've created a self-contained example to find out why this is only working in Firefox: var ul = jQuery('<ul></ul>'); jQuery(selector).children().each(function() { var li = jQuery('<li></li>'); var label = '<label for="' + this.id + '">' + this.name + '</label>'; li.append(label); li.append(this); ul.append(li); }); Any...

Cocoa WebKit - detecting CSS rollover/hover

I have a WebView displaying a HTML page, linking to a CSS file. The CSS file makes use of the pseudoclasses :active and :hover for rollover effects. Q. How can I tell, in my WebView, when :active and :hover have been called? I would like to intercept these calls and act on them programmatically within Cocoa. Thanks. ...

Webkit browser & automation

Have anyone come across open source tools/framework for Webkit browser test automation? ...

Make TBODY scrollable in Webkit browsers

I'm aware of this question, but none of the answers work in Safari, Chrome, etc. The accepted strategy (as demonstrated here) is to set the tbody height and overflow properties like so: <table> <thead> <tr><th>This is the header and doesn't scroll</th></tr> </thead> <tbody style="height:100px; overflow:auto;"> ...

Safari 4: How to profile the code running when the page loads

In Safari 4, I am trying to use the profiler to see how the time is spent in the code that runs when the page loads. I enabled the profiler ("Start profiling JavaScript") I load the page. I stop the profiler. At this point, this doesn't create a "profile" snapshot (while it does if I start the profiler after the page is loaded). Any ...