Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #30 #39

Merged
merged 1 commit into from Apr 25, 2019

Conversation

Projects
None yet
1 participant
@shinsenter
Copy link
Owner

commented Apr 25, 2019

Manually add defer.js library script tag

In some regions, you may want to serve defer.js library locally due to The General Data Protection Regulation (EU).

// Include the library
require_once __DIR__ . '/vendor/shinsenter/defer.php/defer.php';

// Create a Defer object
$defer = new \shinsenter\Defer();
$defer->manually_add_deferjs = true;

// Then get the optimized output
$result = $defer->fromHtml(file_get_contents('mypage.html'))->toHtml();
var_dump($result);
mai.tan

@shinsenter shinsenter merged commit ff9b9a3 into master Apr 25, 2019

1 check passed

CodeFactor No issues found.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.