mirror of
https://github.com/wuchangming/spy-debugger.git
synced 2026-01-18 14:29:45 +00:00
21 lines
491 B
JavaScript
21 lines
491 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 script + match;
|
|
});
|
|
return html;
|
|
};
|
|
|
|
htmlUtil.createScriptTag = function (tpl, showIframe, weinreDomain, weinrePort) {
|
|
return _.template(tpl)({
|
|
showIframe: showIframe,
|
|
weinreDomain: weinreDomain,
|
|
weinrePort: weinrePort
|
|
});
|
|
}; |