BVB Source Codes

prerender Show removeScriptTags.js Source code

Return Download prerender: download removeScriptTags.js Source code - Download prerender Source code - Type:.js
  1. module.exports = {
  2.     beforeSend: function(req, res, next) {
  3.         if(!req.prerender.documentHTML) {
  4.                   return next();
  5.         }
  6.  
  7.         var matches = req.prerender.documentHTML.toString().match(/<script(?:.*?)>(?:[\S\s]*?)<\/script>/gi);
  8.         for (var i = 0; matches && i < matches.length; i++) {
  9.             if(matches[i].indexOf('application/ld+json') === -1) {
  10.                 req.prerender.documentHTML = req.prerender.documentHTML.toString().replace(matches[i], '');
  11.             }
  12.         }
  13.  
  14.         next();
  15.     }
  16. };
  17.  
downloadremoveScriptTags.js Source code - Download prerender Source code
Related Source Codes/Software:
libsodium - A modern and easy-to-use crypto library. 2017-01-09
Side-Menu.Android - Side menu with some categories to choose. ... 2017-01-09
docker-gitlab - Dockerized GitLab http://www.da... 2017-01-09
sinon - Test spies, stubs and mocks for JavaScript. ... 2017-01-09
in-view - Get notified when a DOM element enters or exits th... 2017-01-09
falcon - Falcon is a low-level, high-performance Python fra... 2017-01-09
ImageOptim - GUI image optimizer for Mac htt... 2017-01-09
node-style-guide - A guide for styling your node.js / JavaScript code... 2017-01-09
FDFullscreenPopGesture - A UINavigationController's category to enable full... 2017-01-10
Gource - oftware version control visualization ... 2017-01-10
zen - IOS, Swift, Objective - C 2017-04-25
neural-storyteller - A recurrent neural network for generating little s... 2017-04-25
CTAssetsPickerController - iOS control that allows picking multiple photos an... 2017-04-25
retire - A rich Ruby API and DSL for the Elasticsearch sear... 2017-04-25
jxcore - Evented IO for ChakraCore, SpiderMonkey & V8 J... 2017-04-25
node.io - 2017-04-25
PHPVerbalExpressions - PHP Regular expressions made easy 2017-04-25
Laravel-Administrator - An administrative interface package for Laravel ... 2017-04-25
elasticsearch-dump - Import and export tools for elasticsearch 2017-04-25
flyway - Flyway by Boxfuse Database Migrations Made Easy. ... 2017-04-25

 Back to top