1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-30 17:20:26 +02:00

Correctly load CryptoJS

This commit is contained in:
Uwe L. Korn
2013-07-03 19:51:23 +02:00
parent 0c343a8ad7
commit a9bd4e82b4
4 changed files with 732 additions and 4 deletions

View File

@@ -213,9 +213,17 @@ JSResolver::init()
d->engine->mainFrame()->addToJavaScriptWindowObject( "Tomahawk", d->resolverHelper );
{
// Load a JavaScript SHA256 implementation
d->engine->setScriptPath( "sha256.js" );
QFile jslib( RESPATH "js/sha256.js" );
// Load CrytoJS core
d->engine->setScriptPath( "cryptojs-core.js" );
QFile jslib( RESPATH "js/cryptojs-core.js" );
jslib.open( QIODevice::ReadOnly );
d->engine->mainFrame()->evaluateJavaScript( jslib.readAll() );
jslib.close();
}
{
// Load a SHA256 implementation from CryptoJS
d->engine->setScriptPath( "cryptojs-sha256.js" );
QFile jslib( RESPATH "js/cryptojs-sha256.js" );
jslib.open( QIODevice::ReadOnly );
d->engine->mainFrame()->evaluateJavaScript( jslib.readAll() );
jslib.close();