Comments (8)
Thanks, good suggestion. My aim at the moment is to replicate PhantomJS functionality but I can see the use of having full-size screenshots.
Will get back to you WRT this.
from triflejs.
Full page screenshots are PhantomJS default behaviour. If you hold off on this for now I have a rudimentary patch which causes the built in render function to work in this way (it temporarily resizes the window to it's full scroll height before taking screenshots), but it's on my work computer so I'll send it in Monday.
from triflejs.
HI Dylan, thanks. Updating to Core API, I'll look into it next.
from triflejs.
Hi Dylan, received your code with thanks.
I applied changes, only thing it didnt need was to set the scrollbars as these were already disabled by default.
I've updated the binary TrifleJS.Latest.zip, this is now performing as per PhantomJS now as far as I can tell.
Cherio.
Steven
from triflejs.
Hi Dylan, how important is the extra 50px padding at the bottom?
I'd like to remove it and leave it as is (using browser.Document.Body.ScrollRectangle.Height
) so that I can write some tests to compare output of page.render() vs page.renderBase64().
from triflejs.
The issue it was supposed to address should have occurred with the scroll bars not explicitly disabled but didn't. It looks like it can be safely removed. Please test the release build with this script to make sure there are no scroll bars after doing so:
var page = require('webpage').create();
var url = 'http://wikipedia.org';
var width = 1366;
var height = 768;
var file = 'test.jpg';
page.viewportSize = { width: width, height: height };
page.open(url, function() {
page.render(file);
phantom.exit();
});
Explanation for why it was there
On my debug build page height needed to be extended slightly beyond scroll height to make the scrollbars disappear. The issue with the scroll bars still occurs on my debug build with either the scroll bars not explicitly disabled or the page height not increased. However, with your release build for some reason it does not happen even though scroll bars are not explicitly disabled. So it's probably a good idea to double check but it seems like it should work.
from triflejs.
Thanks for the extended explanation and the actual code for testing, these are very useful. Will test in both Debug and Release, not sure why the difference is there either.
from triflejs.
Checked in c4c5ec4. Working in both Debug and Release with Wikipedia page and triflejs.org (considerably larger height).
All good now as far as I can tell. Width and height looking good. I had to add those 50px in the end as there was no other way to remove the scrollbars.
Closing issue, please reopen if it comes back.
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
- TriffleJS --render fails on http://livedoor.com/ HOT 11
- 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.