spy-debugger/lib/util/htmlUtil.js
wuchangming 89d224cdff add option -i
增加是否监控iframe页面选项
2016-03-22 12:05:52 +08:00

21 lines
489 B
JavaScript

'use strict';
var _ = require('lodash');
var htmlUtil = exports;
// inject script into html
htmlUtil.injectScriptIntoHtml = function (html, script) {
html = html.replace(/(<head>)/i, function (match) {
return match + script;
});
return html;
};
htmlUtil.createScriptTag = function (tpl, showIframe, weinreDomain, weinrePort) {
return _.template(tpl)({
showIframe: showIframe,
weinreDomain: weinreDomain,
weinrePort: weinrePort
});
};