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

Consider moving or loading search script dynamically #251

Open
rmenner opened this issue Oct 16, 2024 · 0 comments
Open

Consider moving or loading search script dynamically #251

rmenner opened this issue Oct 16, 2024 · 0 comments
Assignees

Comments

@rmenner
Copy link
Contributor

rmenner commented Oct 16, 2024

suggestion (performance): Consider moving or loading search script dynamically

The inline script for Google Custom Search might impact initial page load performance. Consider moving it to the bottom of the body or loading it dynamically after the initial page load.

<div role="search">
  <div class="gcse-search"></div>
</div>
<script>
  window.addEventListener('load', function() {
    var script = document.createElement('script');
    script.src = 'https://cse.google.com/cse.js?cx=b792c366f1ce73e3d';
    document.body.appendChild(script);
  });
</script>

Originally posted by @sourcery-ai[bot] in #249 (comment)

@rmenner rmenner self-assigned this Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant