Closed okaufmann closed 3 years ago
I ran into the situation where I need the retrieved HTML as well for a Screenshot request.
When I have something like the following example I can't get the bodyHtml value of browsershot:
$request = Screenshot::loadUrl($url); $request->windowSize(1920, 1080) ->storeAs('public/screenshots', $filename); $html = $request->bodyHtml();
This is because $this is returned for forwarded calls which is fine for the most cases: https://github.com/verumconsilium/laravel-browsershot/blob/master/src/Wrapper.php#L150
$this
For more flexibility I've made the getter browsershot() public to be able to retrieve the html like this:
browsershot()
$request = Screenshot::loadUrl($url); $request->windowSize(1920, 1080) ->storeAs('public/screenshots', $filename); $html = $request->browsershot()->bodyHtml();
More calls where the return value of the function called on browsershot is needed are now possible as well.
I ran into the situation where I need the retrieved HTML as well for a Screenshot request.
When I have something like the following example I can't get the bodyHtml value of browsershot:
This is because
$this
is returned for forwarded calls which is fine for the most cases: https://github.com/verumconsilium/laravel-browsershot/blob/master/src/Wrapper.php#L150For more flexibility I've made the getter
browsershot()
public to be able to retrieve the html like this:More calls where the return value of the function called on browsershot is needed are now possible as well.