Comments (11)
Hiya,
Thanks for the example and debug info. Will chase up when I get a mo.
from triflejs.
I'm having an issue with trifflejs similar to what is mentioned in this old post - ariya/phantomjs#10619.
I'm setting a viewport width of 1420 and height of 800. But the rendered image takes the width correctly but the height is 10425. This makes the document very narrow. I would use clipRect if that works?. Do you know when clipRect will be available for trifflejs?
from triflejs.
Hi @rajeshpaddy,
Can you copy/paste your testing script?
Thanks!
from triflejs.
var page = require('webpage').create();
page.zoomFactor=1;
page.onLoadFinished = function(e) {
setTimeout(function(){
page.render('msn.jpg',{quality:50});
phantom.exit();},30000);
};
page.viewportSize={width:1420,height:800};
console.log(page.viewportSize);
page.localT1oRemoteUrlAccessEnabled =true;
setTimeout(page.open('http://www.msn.com', function() {}),30000);
from triflejs.
In the above example the height is coming out as 5344. I expect it to 800.
from triflejs.
Screenshot and test script received with thanks. Will get to it as soon as I can turn attention back to rendering functionality.
By the way this is related to page.viewportSize
, which is a separate issue to one logged by @juliensobrier, in the future kindly open a separate ticket. Thanks.
from triflejs.
Hi @juliensobrier.
Sorry for taking so long to get back, I think your issue should have been fixed after commit 125e7a0. This was repairing a call to window.navigator
(using page._evaluate()
) before the document had been initialized. Could you try again?
Thanks!
from triflejs.
HI @rajeshpaddy, @juliensobrier.
Try your scripts after fix for frame recursion, should help when rendering websites.
BTW @rajeshpaddy. I'm still to look into page.viewportSize
, I have a feeling that the current functionality is the same as phantomJS (ie that rendered screenshots are not limited by viewport size but always render the whole page). I could be wrong though..
from triflejs.
Hi @rajeshpaddy,
I just checked phantomJS and the script you sent me outputs a file `msn.jpg' that is 1420 x 2444. There is no issue here.. just your own expectation (although I have to admit this is what I thought phantom would do originally when I first wrote the API).
from triflejs.
@sdesalas http://livedoor.com/ still hangs TriffleJS
from triflejs.
Seems ok for me, try using the --render=http://livedoor.com
option on latest binary.
C:\TrifleJS>TrifleJS.exe --render=http://livedoor.com
Rendering http://livedoor.com...
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
Screenshot rendered to file: livedoor.com.png
C:\TrifleJS>
I have to do a bit of work on the event listeners (this is firing many times - probably due to iframes on adverts) but its not hanging and rendering seems ok as far as I can tell (the output png looks good). I haven't tested the page.open()
page.render()
process, and have the feeling that the hanging will still apply if you execute a JS script to do this, however the availability of a working --render
CLI option means it'll be quicker to fix this.
from triflejs.
Related Issues (20)
- window.setTimeout never triggers after 3s HOT 1
- Avoid Window popup HOT 2
- Window SetTimeout / SetInterval don't work when building from source HOT 2
- WebPage.onInitialized is not called when set HOT 7
- window.callPhantom and unhandled error logging are not available until onload event fires. HOT 6
- window.callPhantom doesn't trigger page.onCallback after page.load HOT 8
- page.onCallback() does not handle dates HOT 1
- Can trifleJS use Chakra instead of V8? HOT 3
- clipRect can not work well HOT 2
- Question: Any plans to make this work outside of windows? HOT 1
- System args not populating
- Render pages supplied as text
- TrifleJs in Windows Server
- Crash: Vector smash protection is enabled. HOT 1
- System.IO.FileNotFoundException HOT 1
- webpage method
- uriString can not be null exception when emulating
- trifleJS shut down & builds error :Please install Windows SDK 2010. HOT 1
- About command mode high concurrency HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from triflejs.