OpenWPM/test/test_pages/shared/utils.js

8 строки
323 B
JavaScript

function getParameterByName(name) {
// http://stackoverflow.com/a/901144
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}