Hello,
I'm new to this forum, spending my last few hours searching for information/help, but with no results I decided to join and ask. Hope it's correct place, if not then please move it to more appropriate section.
I have moderate knowledge of C# and Java but was tasked with creating simple(at first glance) Chrome Extension. I wasn't familiar at all with all of quirks and small things that JS comes with, but was doing ok until I got to a point, where I have no idea what to do.
I'm using latest Chrome(41.0.2272.89.m as I'm writing this), with Windows 7 Enterprise.
The problem is that when user fills out one NumericBox and leaves focus(with TAB or clicking something else) onblur() is invoked and some other fields are updated with entered data. But I need to fill these boxes with extension that parses user provided string. And here is root of my problem.
In Chrome developer console, elements pane, when I locate element in question and look at event listeners I can see handler at blur event. Same goes for console:
But, when I look at:
In my extension, to update them all I put element IDs in an array, then foreach it with function that I would like to call blur() handler on each of these elements, but I can't manage to do this and after around 4 hours of research I'm feeling stuck.When debugging with breakpoint inside loop I can see that current processed element has all regular properties except these written in ALL_CAPS and _events
Is it even possible to fire this event from Chrome extension? Everything else so far works ok, but without this continuing this extension will be pointless as user will need to click each field at least once in order to update it.
And I have tried also trying to get those field select()-ed or click()-ed and even simulate keypresses, but nothing helped.
I'm new to this forum, spending my last few hours searching for information/help, but with no results I decided to join and ask. Hope it's correct place, if not then please move it to more appropriate section.
I have moderate knowledge of C# and Java but was tasked with creating simple(at first glance) Chrome Extension. I wasn't familiar at all with all of quirks and small things that JS comes with, but was doing ok until I got to a point, where I have no idea what to do.
I'm using latest Chrome(41.0.2272.89.m as I'm writing this), with Windows 7 Enterprise.
The problem is that when user fills out one NumericBox and leaves focus(with TAB or clicking something else) onblur() is invoked and some other fields are updated with entered data. But I need to fill these boxes with extension that parses user provided string. And here is root of my problem.
In Chrome developer console, elements pane, when I locate element in question and look at event listeners I can see handler at blur event. Same goes for console:
var
element=InputFormOnPageSampleNameForExamplePurposesOnly
element._events.blur[0].handler()
//<-this actually executes and updates what I need!
But, when I look at:
element.blur
//returns
function
blur() { [native code] }
element.blur()
//returns
undefined
In my extension, to update them all I put element IDs in an array, then foreach it with function that I would like to call blur() handler on each of these elements, but I can't manage to do this and after around 4 hours of research I'm feeling stuck.When debugging with breakpoint inside loop I can see that current processed element has all regular properties except these written in ALL_CAPS and _events
Is it even possible to fire this event from Chrome extension? Everything else so far works ok, but without this continuing this extension will be pointless as user will need to click each field at least once in order to update it.
And I have tried also trying to get those field select()-ed or click()-ed and even simulate keypresses, but nothing helped.