Index: test/common.js |
=================================================================== |
--- a/test/common.js |
+++ b/test/common.js |
@@ -12,11 +12,24 @@ |
* GNU General Public License for more details. |
* |
* You should have received a copy of the GNU General Public License |
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
*/ |
function require(module) |
{ |
+ if (!(module in require.scopes)) |
+ { |
+ var script = document.createElement("script"); |
+ script.type = "text/javascript;version=1.7"; |
+ script.src = "/lib/" + module + ".js"; |
+ script.async = false; |
+ document.head.appendChild(script); |
+ |
+ // Huge hack ahead: make sure that the script actually loads synchronously. |
+ var request = new XMLHttpRequest(); |
+ request.open("GET", script.src, false); |
+ request.send(null); |
+ } |
return require.scopes[module]; |
} |
require.scopes = {}; |