[feature?] Block some of requests
See original GitHub issueHi @chrisvfritz!, prerender is awesome project and I’m fascinate of it, but i found one problem which I cant resolve 😕 maybe You can help me 😃 I want to prerender my index.html, who have in body this script:
<script>
WebFontConfig = {
google: { families: ['Lato:300,400,400i,700,900:latin'] }
};
(function () {
var wf = document.createElement('script');
var protocol = ('https:' == document.location.protocol ? 'https' : 'http');
wf.src = protocol + '://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js';
wf.type = 'text/javascript';
wf.defer = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
</script>
It simple get fonts script from google, added to DOM body to improve loading speed and not have block script on start loading a website.
But when prerender plugin render index.html appear for me block script in head section:
<script src="http://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js" type="text/javascript" defer></script><link href="http://fonts.googleapis.com/css?family=Lato:300,400,400i,700,900&subset=latin" rel="stylesheet" media="all">
Is any possibility to not execute and get data (or replace response with my custom data) for some request, in this example: http(s)://ajax.googleapis.com/ajax/libs/webfont/1.5.18/webfont.js
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
How to Block an HTTP Request - tweak browser extension
Request blocking in Chrome or Firefox · Open the devtools panel. · Locate the request you wish to block. · Right-click on the...
Read more >How to use request blocking - Chrome DevTools - Dev Tips
How to use this feature. To use Request Blocking in DevTools: Right click on a resource in the Network Panel. Select Block request...
Read more >Block Network Requests - Requestly
Block any website or URL with a single click using Requestly's Cancel Request rule, It will make the blocked URL completely inaccessible.
Read more >How to block a URL in Chrome's developer tools network ...
Right-click on the request in the Network panel and select Block Request URL. A new Request blocking tab pops up in the Drawer,...
Read more >New Feature: Request Blocker 3.0 (Video)
The new Request Blocker 3.0 feature allows you to customize your Navigation Auto-Request Blocking in four different levels for faster and ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@radzikowski It’s not possible to replace the response data, but you can prevent third-party requests from being loaded by adding
skipThirdPartyRequests: true
to the renderer config. In this case, loading fonts is not critical for prerendering, so you should addskipThirdPartyRequests: true
.@radzikowski An allow/deny system for individual URLs would likely be ideal, but I haven’t thought through the best way to get it working consistently in all renderers. Feel free to PR if you have an idea. 😃