vitebonus / closure-library

Automatically exported from code.google.com/p/closure-library
0 stars 0 forks source link

goog.uri.utils.phishingProtection_ mistakenly detect phishing possibility on PhantomJS. #624

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago

What steps will reproduce the problem?
1. Instantiate goog.Uri in the script file of PhantomJS.
2. Load that file to PhantomJS.
3. Error thrown from goog.uri.utils.phishingProtection_.

What is the expected output? What do you see instead?
get the instance of goog.Uri without aborting by Error.

What version of the product are you using? On what operating system?
PhantomJS - 1.9.2

Please provide any additional information below.
'location' object in PhantomJS is like...

 {"origin":"file://","hash":"","href":"file://compiled/compiled.js","pathname":"compiled/compiled.js","hostname":"","protocol":"file:","port":"","host":"","search":""}

Therefore, condition below

 if (domain && domain != location['hostname'])

compares

 'compiled' != ''

Finally, empty error thrown from this conditional block.

Note: we cannot accept patches without the contributor license agreement
being signed. See http://code.google.com/p/closure-
library/wiki/Contributors for more info.

Original issue reported on code.google.com by tomonori...@gmail.com on 24 Jan 2014 at 11:57