bbc / wraith

Wraith — A responsive screenshot comparison tool
http://bbc-news.github.io/wraith/
Apache License 2.0
4.84k stars 358 forks source link

"unsafe javascript attempt to access fram with URL" #456

Closed Qlczas closed 7 years ago

Qlczas commented 8 years ago

Hello, I have various problem with Wraith, first I've got stuck at "snapping pictures" but now I've got

Wraith 3.2.0 PhantomJS 1.9.8.0 ImageMagick 6.9.5-2 Q8 64-Bit


Reporting a problem? Please describe the issue above, and complete the following checklist so that we can help you more quickly.

Issue checklist:

I can't run my config with "verbose: true" :/ it's not starting at all


C:\Wraith>wraith capture configs/test.yaml   & PAUSE
Config validated. No serious issues found.
Creating Folders
SAVING IMAGES
Loading http://www.onet.pl/ at dimensions: 600x768

Loading http://onet.pl/ at dimensions: 600x768

Loading http://www.onet.pl/ at dimensions: 1024x1500

Loading http://onet.pl/ at dimensions: 1024x1500

Snapping http://www.onet.pl/ at: 1024x1500

Unsafe JavaScript attempt to access frame with URL about:blank from frame with U
RL file:///C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.0/lib/wraith/javasc
ript/phantom.js. Domains, protocols and ports must match.

Unsafe JavaScript attempt to access frame with URL about:blank from frame with U
RL file:///C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.0/lib/wraith/javasc
ript/phantom.js. Domains, protocols and ports must match.

Unsafe JavaScript attempt to access frame with URL about:blank from frame with U
RL file:///C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.0/lib/wraith/javasc
ript/phantom.js. Domains, protocols and ports must match.

Unsafe JavaScript attempt to access frame with URL about:blank from frame with U
RL file:///C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.0/lib/wraith/javasc
ript/phantom.js. Domains, protocols and ports must match.

Snapping http://www.onet.pl/ at: 600x768

Snapping http://onet.pl/ at: 600x768
##############################################################
##############################################################
# This is an example configuration provided by Wraith.
# Feel free to amend for your own requirements.
# ---
# This particular config is intended to demonstrate how
# to use Wraith in 'capture' mode, which is best suited to
# comparing a test and live version of the same website.
#
# `wraith capture capture.yaml`
#
##############################################################
##############################################################

# (required) The engine to run Wraith with. Examples: 'phantomjs', 'casperjs', 'slimerjs'
browser: "phantomjs"

# (required) The domains to take screenshots of.
domains:
  current:  "http://www.onet.pl"
  new:      "http://onet.pl"

# (required) The paths to capture. All paths should exist for both of the domains specified above.
paths:
  home:     /
  #about:    /about
  #contact:  /get-in-touch

# (required) Screen widths (and optional height) to resize the browser to before taking the screenshot.
screen_widths:
  #- 320
  - 600x768
  #- 768
  - 1024
  #- 1280

# (optional) JavaScript file to execute before taking screenshot of every path. Default: nil
before_capture: 'javascript/disable_javascript--phantom.js'

# (required) The directory that your screenshots will be stored in
directory: 'shots'

# (required) Amount of fuzz ImageMagick will use when comparing images. A higher fuzz makes the comparison less strict.
fuzz: '20%'

# (optional) The maximum acceptable level of difference (in %) between two images before Wraith reports a failure. Default: 0
threshold: 5

# (optional) Specify the template (and generated thumbnail sizes) for the gallery output.
gallery:
  template: 'slideshow_template' # Examples: 'basic_template' (default), 'slideshow_template'
  thumb_width:  200
  thumb_height: 200

# (optional) Choose which results are displayed in the gallery, and in what order. Default: alphanumeric
# Options:
#   alphanumeric - all paths (with or without a difference) are shown, sorted by path
#   diffs_first - all paths (with or without a difference) are shown, sorted by difference size (largest first)
#   diffs_only - only paths with a difference are shown, sorted by difference size (largest first)
# Note: different screen widths are always grouped together.
mode: diffs_first
verbose: true
Qlczas commented 8 years ago

hello... any help? been almost two weeks...

SimonKeep commented 8 years ago

This isn't going to help much but your config works for me.

ChrisBAshton commented 8 years ago

@Qlczas it sounds as though 'Unsafe JavaScript attempt to access frame' isn't necessarily the issue here - your last line of copied output is Snapping http://onet.pl/ at: 600x768, so what happened then - does the program just hang, or does it go on to generate a gallery?

FYI, I've copied it locally and it works for me too - though I had to comment out the before_capture hook because I didn't have the disable-javascript file, but it did end up creating a gallery. Maybe try disabling the before_capture hook and see if you still have the issue?

If it helps, my output is below:

Output from my machine $ wraith capture conf.yml DEBUG: ################################################# DEBUG: Command run: capture conf.yml DEBUG: Wraith version: 3.2.1 DEBUG: Ruby version: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14] DEBUG: ImageMagick: Version: ImageMagick 6.9.1-9 Q16 x86_64 2015-07-19 http://www.imagemagick.org DEBUG: PhantomJS version: 2.1.1 DEBUG: CasperJS version: Couldn't find nor compute phantom.casperPath, exiting. DEBUG: ################################################# DEBUG: Config validated. No serious issues found. Creating Folders SAVING IMAGES DEBUG: phantomjs '/Users/ashtoc03/.rvm/gems/ruby-2.2.1/gems/wraith-3.2.1/lib/wraith/javascript/phantom.js' 'http://www.onet.pl/' '600x768' 'shots/home/600x768_phantomjs_current.png' 'body' 'false' 'false' DEBUG: phantomjs '/Users/ashtoc03/.rvm/gems/ruby-2.2.1/gems/wraith-3.2.1/lib/wraith/javascript/phantom.js' 'http://onet.pl/' '600x768' 'shots/home/600x768_phantomjs_new.png' 'body' 'false' 'false' DEBUG: phantomjs '/Users/ashtoc03/.rvm/gems/ruby-2.2.1/gems/wraith-3.2.1/lib/wraith/javascript/phantom.js' 'http://www.onet.pl/' '1024' 'shots/home/1024_phantomjs_current.png' 'body' 'false' 'false' DEBUG: phantomjs '/Users/ashtoc03/.rvm/gems/ruby-2.2.1/gems/wraith-3.2.1/lib/wraith/javascript/phantom.js' 'http://onet.pl/' '1024' 'shots/home/1024_phantomjs_new.png' 'body' 'false' 'false' Loading http://onet.pl/ at dimensions: 600x768 Loading http://onet.pl/ at dimensions: 1024x1500 Loading http://www.onet.pl/ at dimensions: 1024x1500 Loading http://www.onet.pl/ at dimensions: 600x768 Snapping http://www.onet.pl/ at: 600x768 Snapping http://www.onet.pl/ at: 1024x1500 Snapping http://onet.pl/ at: 1024x1500 Snapping http://onet.pl/ at: 600x768 CROPPING IMAGES DEBUG: Both images are exactly 600x768 - no cropping required. (shots/home/600x768_phantomjs_current.png, shots/home/600x768_phantomjs_new.png) DEBUG: Both images are exactly 1024x1500 - no cropping required. (shots/home/1024_phantomjs_current.png, shots/home/1024_phantomjs_new.png) COMPARING IMAGES Comparing shots/home/1024_phantomjs_current.png and shots/home/1024_phantomjs_new.png Comparing shots/home/600x768_phantomjs_current.png and shots/home/600x768_phantomjs_new.png Saved diff Saved diff GENERATING THUMBNAILS GENERATING GALLERY Gallery generated WARN: Failures detected: WARN: home failed at a resolution of 600 (18.04% diff) WARN: home failed at a resolution of 1024 (54.3% diff) View the gallery in your browser: file:///Users/ashtoc03/Downloads/shots/gallery.html
SimonKeep commented 8 years ago

I tried it with the diasable-javascript file so its not that.

Qlczas commented 8 years ago

Hello again, thanks for all the replies.

I've updated to Wraith 3.2.1 I've updated to PhantjomJS 2.1 because with 1.9.8 Wraith won't even start at all. And now with PhantomJS2.1 I receive following errors:

C:\Wraith>wraith capture configs/test.yaml & PAUSE Fatal Windows exception, code 0xc0000005. PhantomJS has crashed. Please read the bug reporting guide at http://phantomjs.org/bug-reporting.html and file a bug report. DEBUG: ################################################# DEBUG: Command run: capture configs/test.yaml DEBUG: Wraith version: 3.2.1 DEBUG: Ruby version: ruby 2.3.0p0 (2015-12-25 revision 53290) [x64-mingw 32]

DEBUG: ImageMagick: Version: ImageMagick 6.9.5-2 Q8 x64 2016-07-11 http ://www.imagemagick.org

DEBUG: PhantomJS version: 2.1.1

DEBUG: CasperJS version: CasperJS not installed DEBUG: ################################################# DEBUG: Config validated. No serious issues found. Creating Folders SAVING IMAGES DEBUG: phantomjs 'C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.1/lib/wrait h/javascript/phantom.js' 'http://www.onet.pl/' '600x768' 'shots/home/600x768_pha ntomjs_current.png' 'body' 'C:/Wraith/javascript/disable_javascript--phantom.js' 'false' DEBUG: phantomjs 'C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.1/lib/wrait h/javascript/phantom.js' 'http://onet.pl/' '600x768' 'shots/home/600x768_phantom js_new.png' 'body' 'C:/Wraith/javascript/disable_javascript--phantom.js' 'false'

DEBUG: phantomjs 'C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.1/lib/wrait h/javascript/phantom.js' 'http://www.onet.pl/' '1024' 'shots/home/1024_phantomjs _current.png' 'body' 'C:/Wraith/javascript/disable_javascript--phantom.js' 'fals e' DEBUG: phantomjs 'C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.1/lib/wrait h/javascript/phantom.js' 'http://onet.pl/' '1024' 'shots/home/1024_phantomjs_new .png' 'body' 'C:/Wraith/javascript/disable_javascript--phantom.js' 'false' Can't open ''C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.1/lib/wraith/java script/phantom.js'' Can't open ''C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.1/lib/wraith/java script/phantom.js'' Fatal Windows exception, code 0xc0000005. PhantomJS has crashed. Please read the bug reporting guide at http://phantomjs.org/bug-reporting.html and file a bug report. WARN: Failed to capture image shots/home/600x768_phantomjs_current.png on attemp t number 1 of 5 Fatal Windows exception, code 0xc0000005. PhantomJS has crashed. Please read the bug reporting guide at http://phantomjs.org/bug-reporting.html and file a bug report. Can't open ''C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.1/lib/wraith/java script/phantom.jCsa'n'' t open ''C:/Ruby23-x64/lib/ruby/gemWARN: Failed to capture image shots/home/600x 768_phantomjs_new.png on attempt number 1 of 5 s/2.3.0/gems/wraith-3.2.1/lib/wraith/javascript/phantom.js'' Fatal Windows exception, code 0xc0000005. PhantomJS has crashed. Please read the bug reporting guide at http://phantomjs.org/bug-reporting.html and file a bug report. Fatal Windows exception, code 0xc0000005. PhantomJS has crashed. Please read the bug reporting guide at http://phantomjs.org/bug-reporting.html and file a bug report. WARN: Failed to capture image shots/home/1024_phantomjs_new.png on attempt numbe r 1 of 5 WARN: Failed to capture image shots/home/1024_phantomjs_current.png on attempt n umber 1 of 5 Can't open ''C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.1/lib/wraith/java script/phantom.js'' Can't open ''C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.1/lib/wraith/java script/phantom.js'' Fatal Windows exception, code 0xc0000005. PhantomJS has crashed. Please read the bug reporting guide at http://phantomjs.org/bug-reporting.html and file a bug report. WARN: Failed to capture image shots/home/600x768_phantomjs_current.png on attemp t number 2 of 5 Fatal Windows exception, code 0xc0000005. PhantomJS has crashed. Please read the bug reporting guide at http://phantomjs.org/bug-reporting.html and file a bug report. WARN: Failed to capture image shots/home/600x768_phantomjs_new.png on attempt nu mber 2 of 5 Can't open ''C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.1/lib/wraith/java script/phantom.js'' Fatal Windows exception, code 0xc0000005. PhantomJS has crashed. Please read the bug reporting guide at http://phantomjs.org/bug-reporting.html and file a bug report. WARN: Failed to capture image shots/home/1024_phantomjs_current.png on attempt n umber 2 of 5 Can't open ''C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.1/lib/wraith/java script/phantom.js'' Fatal Windows exception, code 0xc0000005. PhantomJS has crashed. Please read the bug reporting guide at http://phantomjs.org/bug-reporting.html and file a bug report. WARN: Failed to capture image shots/home/1024_phantomjs_new.png on attempt numbe r 2 of 5 Can't open ''C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.1/lib/wraith/java script/phantom.js'' Fatal Windows exception, code 0xc0000005. PhantomJS has crashed. Please read the bug reporting guide at http://phantomjs.org/bug-reporting.html and file a bug report. WARN: Failed to capture image shots/home/600x768_phantomjs_current.png on attemp t number 3 of 5 Can't open ''C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.1/lib/wraith/java script/phantom.js'' Fatal Windows exception, code 0xc0000005. PhantomJS has crashed. Please read the bug reporting guide at http://phantomjs.org/bug-reporting.html and file a bug report. WARN: Failed to capture image shots/home/600x768_phantomjs_new.png on attempt nu mber 3 of 5 Can't open ''C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.1/lib/wraith/java script/phantom.js'' Can't open ''C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.1/lib/wraith/java script/phantom.js'' Fatal Windows exception, code 0xc0000005. PhantomJS has crashed. Please read the bug reporting guide at http://phantomjs.org/bug-reporting.html and file a bug report. WARN: Failed to capture image shots/home/1024_phantomjs_current.png on attempt n umber 3 of 5 Fatal Windows exception, code 0xc0000005. PhantomJS has crashed. Please read the bug reporting guide at http://phantomjs.org/bug-reporting.html and file a bug report. WARN: Failed to capture image shots/home/1024_phantomjs_new.png on attempt numbe r 3 of 5 CCaan'nt 'otp eonp e'n' C':'/CR:u/bRyu2b3y-2x36-4x/6l4i/bl/irbu/bryu/bgye/mgse/m 2s./32..03/.g0e/mgse/mwsr/awirtahi-t3h.-23..12/.l1i/bl/iwbr/awirtahi/tjha/vjaasv carsicprti/ppth/apnhtaonmt.ojms.'j's '' Fatal Windows exception, code 0xc0000005. PhantomJS has crashed. Please read the bug reporting guide at http://phantomjs.org/bug-reporting.html and file a bug report. Fatal Windows exception, code 0xc0000005. PhantomJS has crashed. Please read the bug reporting guide at http://phantomjs.org/bug-reporting.html and file a bug report. WARN: Failed to capture image shots/home/600x768_phantomjs_new.png on attempt nu mber 4 of 5 WARN: Failed to capture image shots/home/600x768_phantomjs_current.png on attemp t number 4 of 5 Can't open ''C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.1/lib/wraith/java script/phantom.js'' Can't open ''C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wraith-3.2.1/lib/wraith/java script/phantom.js'' Fatal Windows exception, code 0xc0000005. PhantomJS has crashed. Please read the bug reporting guide at http://phantomjs.org/bug-reporting.html and file a bug report. Fatal Windows exception, code 0xc0000005. WARN: Failed to capture image shots/home/1024_phantomjs_current.png on attempt n umber 4 of 5 PhantomJS has crashed. Please read the bug reporting guide at http://phantomjs.org/bug-reporting.html and file a bug report. WARN: Failed to capture image shots/home/1024_phantomjs_new.png on attempt numbe r 4 of 5 CCCCaaaannnn''''tttt ooooppppeeeennnn ''''''''CCCC::::////RRRRuuuubbbbyyyy 22223333----xxxx66664444////lllliiiibbbb////rrrruuuubbbbyyyy////ggggeeeemmmmssss ////2222....3333....0000////ggggeeeemmmmssss////wwwwrrrraaaaiiiitttthhhh----3333 ....2222....1111////lllliiiibbbb////wwwwrrrraaaaiiiitttthhhh////jjjjaaaavvvvaaaa ssssccccrrrriiiipppptttt////pppphhhhaaaannnnttttoooommmm....jjjjssss''''''''

Fatal Windows exception, code 0xc0000005. Fatal Windows exception, code 0xc0000005. PhantomJS has crashed. Please read the bug reporting guide at http://phantomjs.org/bug-reporting.html and file a bug report. PhantomJS has crashed. Please read the bug reporting guide at http://phantomjs.org/bug-reporting.html and file a bug report. Fatal Windows exception, code 0xc0000005. Fatal Windows exception, code 0xc0000005. PhantomJS has crashed. Please read the bug reporting guide at http://phantomjs.org/bug-reporting.html and file a bug report. PhantomJS has crashed. Please read the bug reporting guide at http://phantomjs.org/bug-reporting.html and file a bug report. WARN: Failed to capture image shots/home/600x768_phantomjs_current.png on attemp t number 5 of 5 ERROR: Unable to capture image shots/home/600x768_phantomjs_current.png after 5 attempt(s) WARN: Using fallback image instead WARN: Failed to capture image shots/home/600x768_phantomjs_new.png on attempt nu mber 5 of 5 ERROR: Unable to capture image shots/home/600x768_phantomjs_new.png after 5 atte mpt(s) WARN: Using fallback image instead WARN: Failed to capture image shots/home/1024_phantomjs_current.png on attempt n umber 5 of 5 ERROR: Unable to capture image shots/home/1024_phantomjs_current.png after 5 att empt(s) WARN: Using fallback image instead WARN: Failed to capture image shots/home/1024_phantomjs_new.png on attempt numbe r 5 of 5 ERROR: Unable to capture image shots/home/1024_phantomjs_new.png after 5 attempt (s) WARN: Using fallback image instead CROPPING IMAGES Process.fork is not supported by this Ruby DEBUG: Both images are exactly 1024x500 - no cropping required. (shots/home/1024 _phantomjs_current.png, shots/home/1024_phantomjs_new.png) DEBUG: Both images are exactly 600x768 - no cropping required. (shots/home/600x7 68_phantomjs_current.png, shots/home/600x768_phantomjs_new.png) COMPARING IMAGES Process.fork is not supported by this Ruby Comparing shots/home/1024_phantomjs_current.png and shots/home/1024_phantomjs_ne w.png Saved diff Comparing shots/home/600x768_phantomjs_current.png and shots/home/600x768_phanto mjs_new.png Saved diff GENERATING THUMBNAILS Process.fork is not supported by this Ruby GENERATING GALLERY Gallery generated

View the gallery in your browser: file://C:/Wraith/shots/gallery.html Press any key to continue . . .

ChrisBAshton commented 7 years ago

This is quite possibly down to #489 - Wraith's attempt at getting PhantomJS and Windows playing nicely together needs a little bit of work!

RE:

I can't run my config with "verbose: true" :/ it's not starting at all

If you upgrade to Wraith v4 you can now run wraith info - could you do that and paste the contents here?

Qlczas commented 7 years ago

Hi again, sorry for long silence. This can be closed. I've managed to run wraith succesffully - the issue I had was with one of our pages it was behind logging system which was causing Wraith not to take screenshots. But other project is working fine, the versions that are working on my Lenovo Thinkpad with Windows 7 are: -Wraith 3.2.1 -Ruby environment as a Windows installer (version 2.3.1), -ImageMagick (version 7.0.3) -PhantomJS (version 1.9.8) Only hack needed is for Ruby problems, Work around: Certification file „GlobalSignRootCA.pem” has to be copied to below folder (after installation of Ruby): C:\Ruby23\lib\ruby\2.3.0\rubygems\ssl_certs (or the path of your ruby)

thanks for all the help

ChrisBAshton commented 7 years ago

Ok, great.

spsmanikandan commented 7 years ago

Could someone help me with the steps for downgrading from Phantomjs 2.1.1 to 1.9.8?