--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.
Hi,There is an autofocus HTML5 attribute that you can use in Chrome which means that you do not have to resort to javascript.For example:<input name="q" type="text" autofocus>Kind RegardsPaul
I work with the author of this thread. What we've observed is that
auto-focus doesn't work in **page actions**. Your example uses browser
actions, which is why it works. I'm unable to attach files to this
post via the web interface, but please try the following and you'll
see this bug in action.
manifest.json:
----------------------
{
"name": "TestAutofocus",
"version" : "1.0.0.0",
"background_page": "background.html",
"page_action": {
"default_icon": "test.png",
"default_title": "Testing Autofocus",
"popup": "popup.html"
},
"permissions": [
"tabs"
]
}
background.html:
----------------------
<html>
<body>
<script type="text/javascript" src="background.js"></script>
</body>
</html>
background.js:
----------------------
chrome.windows.getAll({'populate': true}, function(windows) {
for (var i = 0, window; window = windows[i]; i++) {
for (var j = 0, tab; tab = window.tabs[j]; j++) {
chrome.pageAction.show(tab.id);
}
}
});
popup.html:
----------------------
<html>
<body>
<form>
<input type="text" autofocus>
</form>
</body>
</html>
Thanks,
Adam
On Feb 22, 10:32 am, Paul Kinlan <paulkin...@chromium.org> wrote:
> Hi,
>
> I have just tested autofocus on a couple of devices (namely a mac and a
> windows machine 4.0.249.89) and all seems well. The example had two input
> boxes inside a form and requested that the second input box be autofocused.
>
> I have attached the sample I created so you can check against that to see if
> it works on your windows box. I think this example replicates what you are
> after.
>
> If this works and your code still doesn't would you be able to provide us
> with a minimal example of your problem and the version number of Chrome that
> it does not work on.
>
> Thanks,
> Paul Kinlan
>
>
>
> On Mon, Feb 22, 2010 at 8:53 AM, Lindsey Simon <lsi...@commoner.com> wrote:
> > Ah, cool, very good to know about. I added that to my popup.html, and even
> > completely removed my javascript from the page, but when the popup loads in
> > windows, the text input still does not get focused.
> > It is a simple form with just a text input and a submit button.
> > Thanks
>
> > On Sun, Feb 21, 2010 at 2:47 PM, Paul Kinlan <paulkin...@chromium.org>wrote:
>
> >> Hi,
>
> >> There is an autofocus HTML5 attribute that you can use in Chrome which
> >> means that you do not have to resort to javascript.
>
> >> For example:
> >> <input name="q" type="text" autofocus>
>
> >> Kind Regards
> >> Paul
>
> >> On Fri, Feb 19, 2010 at 3:13 PM, elsigh <els...@gmail.com> wrote:
>
> >>> In our popup.html we have a <input id="foo" type="text">
> >>> and we call a function when the body onload event occurs which has a
> >>> line: document.getElementById('foo').focus();
> >>> This works correctly in Chrome Linux and Mac, but not in Windows.
> >>> I've tried various tricks(different ways of hooking the event,
> >>> setTimeout(focusFunction, 0) to get it to work and had no luck.
>
> >>> --
> >>> You received this message because you are subscribed to the Google Groups
> >>> "Chromium-extensions" group.
> >>> To post to this group, send email to chromium-extensi...@chromium.org.
> >>> To unsubscribe from this group, send email to
> >>> chromium-extensions+unsubscr...@chromium.org<chromium-extensions%2Bunsubscr...@chromium.org>
> >>> .
> >>> For more options, visit this group at
> >>>http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en
> >>> .
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Chromium-extensions" group.
> > To post to this group, send email to chromium-extensi...@chromium.org.
> > To unsubscribe from this group, send email to
> > chromium-extensions+unsubscr...@chromium.org<chromium-extensions%2Bunsubscr...@chromium.org>
> > .
> > For more options, visit this group at
> >http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.
>
>
>
> autofocus 2.zip
> 1KViewDownload
To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.