Skip to content

Commit

Permalink
Bugfix for issue #2
Browse files Browse the repository at this point in the history
The child count of a node can increase while parsing it if we find
numbers and convert them into dial tooltips. If all the numbers are
childs of one node and we iterate over it then we have to read the
length of the child nodes for each loop otherwise the parser will stop
to early.
  • Loading branch information
tap-chris committed May 14, 2015
1 parent 959b0a7 commit dd95711
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions scripts/cisco_dialer_content.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,10 @@ var ciscoDialerContentScript = new function () {

this.parseNode = function (node) {
var nodeName = node.nodeName.toLowerCase();
var childNodes = node.childNodes.length;

if (this.dontParse.indexOf(nodeName) < 0) {
var phoneNumbers = [];
for (var nodeIndex = 0; nodeIndex < childNodes; nodeIndex++) {
for (var nodeIndex = 0; nodeIndex < node.childNodes.length; nodeIndex++) {
var child = node.childNodes[nodeIndex];

if (child.nodeType == Node.TEXT_NODE) {
Expand Down

0 comments on commit dd95711

Please sign in to comment.