tl;dr an element that is draggable when viewed in Chrome isn't draggable when viewed in Chrome Packaged App's <webview>
, why?
EDIT:
Tested on Chrome 29.0.1521.3 dev, still no luck when inside packaged app, but Chrome itself works fine.
Experimenting with Chrome Packaged Apps, I wanted to test the capability of the WebView... Apparently, pages loaded within the WebView should behave exactly as if it was being viewed from Chrome itself (apart from a few features being disabled).
I made an app that consisted solely of a page with a single <webview>
. The inner page shows an <ol>
with three <li>
elements. Each <li>
has the draggable="true"
attribute, but no matter what I try, the elements do not react at all to a drag.
I know Chrome Packaged Apps have many CSS declarations to avoid the user selecting text, etc. but is there anything in there to stop things being dragged?
manifest.json
{
"manifest_version": 2,
"name": "WebView test",
"minimum_chrome_version": "24.0.1307.0",
"version": "1.0",
"icons": {
"16": "Icon_16.png",
"128": "Icon_128.png"
},
"app": {
"background": {
"scripts": ["Main.js"]
}
},
"permissions": [
"webview"
]
}
Main.js
chrome.app.runtime.onLaunched.addListener(function() {
runApp();
});
chrome.app.runtime.onRestarted.addListener(function() {
runApp();
});
function runApp() {
chrome.app.window.create('Test.html', {
"minWidth": 500,
"minHeight": 700,
"frame": "none",
"resizable": false,
});
}
Test.html
<!doctype html>
<webview src="http://localhost/WebViewPage.html" style="width:100%;height:100%"></webview>
WebViewPage.html
<ol>
<li draggable="true">One</li>
<li draggable="true">Two</li>
<li draggable="true">Three</li>
</ol>
<script>
// Returns "true":
console.log('draggable' in document.createElement('li'));
</script>
The above LIs should at least do something when the user drags them, but they don't react at all.