diff --git a/.gitignore b/.gitignore index 3cea212..23950ee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ build dist lcov -node_modules +node_modules \ No newline at end of file diff --git a/src/common/common.js b/src/common/common.js index b6cce63..141d315 100644 --- a/src/common/common.js +++ b/src/common/common.js @@ -115,6 +115,7 @@ cs: { label: 'C#' }, java: { label: 'Java' }, robot: { label: 'Robot Framework' } + }; // first timer diff --git a/src/common/generator.js b/src/common/generator.js index 113326f..2cbca6b 100644 --- a/src/common/generator.js +++ b/src/common/generator.js @@ -8,7 +8,7 @@ window.POG=(function() { // ======================================================================== // private functions - + function getAttributeSelector(name, node) { var response = ''; var value = node.getAttribute(name); @@ -21,9 +21,21 @@ window.POG=(function() { else { selector += '[' + name + '=\'' + value + '\']'; } - if (document.querySelectorAll(selector).length === 1) { - response = selector; - } + //Surrounding with try to catch the exceptions that occur and crash the program on + //certain web pages. + try + { + if (document.querySelectorAll(selector).length === 1) { + response = selector; + } + } + catch (e) { + + console.log(e); + console.log("Bad selector: " + selector); + } + + } return response; diff --git a/testssh.txt b/testssh.txt new file mode 100644 index 0000000..1ad6cdf --- /dev/null +++ b/testssh.txt @@ -0,0 +1 @@ +Hello from the other side.