opt: disable websecurity to enable cross domain access

without this , javascript can not access certain website dictionary (using iframe )
add --disable-web-security to qapplication argv
This commit is contained in:
Xiao YiFang 2022-07-09 11:04:39 +08:00
parent 7cac8c79b8
commit 3ef3535213

13
main.cc
View file

@ -274,7 +274,18 @@ int main( int argc, char ** argv )
qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "1");
QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
QHotkeyApplication app( "GoldenDict", argc, argv );
char ARG_DISABLE_WEB_SECURITY[] = "--disable-web-security";
int newArgc = argc + 1 + 1;
char ** newArgv = new char *[ newArgc ];
for( int i = 0; i < argc; i++ )
{
newArgv[ i ] = argv[ i ];
}
newArgv[ argc ] = ARG_DISABLE_WEB_SECURITY;
newArgv[ argc + 1 ] = nullptr;
QHotkeyApplication app( "GoldenDict", newArgc, newArgv );
LogFilePtrGuard logFilePtrGuard;
if ( app.isRunning() )