Giter Club home page Giter Club logo

Comments (8)

sdesalas avatar sdesalas commented on July 19, 2024

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.

DylanDonkersgoed avatar DylanDonkersgoed commented on July 19, 2024

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.

sdesalas avatar sdesalas commented on July 19, 2024

HI Dylan, thanks. Updating to Core API, I'll look into it next.

from triflejs.

sdesalas avatar sdesalas commented on July 19, 2024

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.

sdesalas avatar sdesalas commented on July 19, 2024

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.

DylanDonkersgoed avatar DylanDonkersgoed commented on July 19, 2024

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.

sdesalas avatar sdesalas commented on July 19, 2024

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.

sdesalas avatar sdesalas commented on July 19, 2024

Hi @DylanDonkersgoed,

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.