alexscheelmeyer / node-phantom

bridge to PhantomJS from Node.js
317 stars 117 forks source link

After setting userAgent, page doesn't navigate #73

Open dpecos opened 10 years ago

dpecos commented 10 years ago

In order to set the userAgent property to the 'settings' object of the page, I have to set all the properties, not just userAgent, otherwise it won't get any content.

          page.set 'settings',
            userAgent: 'test'
            XSSAuditingEnabled: false,
            javascriptCanCloseWindows: true,
            javascriptCanOpenWindows: true,
            javascriptEnabled: true,
            loadImages: false,
            localToRemoteUrlAccessEnabled: false,
            webSecurityEnabled: true

In order to test it, if you get the "settings" after doing a set, you will get only those properties that were set, losing the rest of them.

Thanks!