mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-30 21:34:07 +00:00
1.js undefined error
2,disable chrome auto play feature
This commit is contained in:
parent
4a5af10277
commit
17afc21478
|
@ -185,7 +185,7 @@ std::string ArticleMaker::makeHtmlHeader( QString const & word,
|
||||||
"el=document.getElementById( gdCurrentArticle ); el.className = el.className.replace(' gdactivearticle','');"
|
"el=document.getElementById( gdCurrentArticle ); el.className = el.className.replace(' gdactivearticle','');"
|
||||||
"el=document.getElementById( 'gdfrom-' + newId ); el.className = el.className + ' gdactivearticle';"
|
"el=document.getElementById( 'gdfrom-' + newId ); el.className = el.className + ' gdactivearticle';"
|
||||||
"gdCurrentArticle = 'gdfrom-' + newId; gdAudioLinks.current = newId;"
|
"gdCurrentArticle = 'gdfrom-' + newId; gdAudioLinks.current = newId;"
|
||||||
"articleview.onJsActiveArticleChanged(gdCurrentArticle); } }"
|
" } }"
|
||||||
"var overIframeId = null;"
|
"var overIframeId = null;"
|
||||||
"function gdSelectArticle( id ) {"
|
"function gdSelectArticle( id ) {"
|
||||||
"var selection = window.getSelection(); var range = document.createRange();"
|
"var selection = window.getSelection(); var range = document.createRange();"
|
||||||
|
@ -630,13 +630,6 @@ void ArticleRequest::bodyFinished()
|
||||||
{
|
{
|
||||||
head += "</div></div><div style=\"clear:both;\"></div><span class=\"gdarticleseparator\"></span>";
|
head += "</div></div><div style=\"clear:both;\"></div><span class=\"gdarticleseparator\"></span>";
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// This is the first article
|
|
||||||
head += "<script type=\"text/javascript\">"
|
|
||||||
"var gdCurrentArticle=\"" + gdFrom + "\"; "
|
|
||||||
"articleview.onJsActiveArticleChanged(gdCurrentArticle)</script>";
|
|
||||||
}
|
|
||||||
|
|
||||||
bool collapse = false;
|
bool collapse = false;
|
||||||
if( articleSizeLimit >= 0 )
|
if( articleSizeLimit >= 0 )
|
||||||
|
|
|
@ -272,7 +272,6 @@ ArticleView::ArticleView( QWidget * parent, ArticleNetworkAccessManager & nm,
|
||||||
connect( ui.definition, SIGNAL( loadFinished( bool ) ),
|
connect( ui.definition, SIGNAL( loadFinished( bool ) ),
|
||||||
this, SLOT( loadFinished( bool ) ) );
|
this, SLOT( loadFinished( bool ) ) );
|
||||||
|
|
||||||
attachToJavaScript();
|
|
||||||
// connect( ui.definition->page(), SIGNAL( javaScriptWindowObjectCleared() ),
|
// connect( ui.definition->page(), SIGNAL( javaScriptWindowObjectCleared() ),
|
||||||
// this, SLOT( attachToJavaScript() ) );
|
// this, SLOT( attachToJavaScript() ) );
|
||||||
|
|
||||||
|
@ -753,6 +752,7 @@ void ArticleView::setCurrentArticle( QString const & id, bool moveToIt )
|
||||||
"}").arg(articleId).arg(moveToIt).arg(id);
|
"}").arg(articleId).arg(moveToIt).arg(id);
|
||||||
|
|
||||||
ui.definition->page()->runJavaScript(script);
|
ui.definition->page()->runJavaScript(script);
|
||||||
|
onJsActiveArticleChanged(id);
|
||||||
// if ( getArticlesList().contains( id.mid( 7 ) ) )
|
// if ( getArticlesList().contains( id.mid( 7 ) ) )
|
||||||
// {
|
// {
|
||||||
|
|
||||||
|
|
|
@ -1301,6 +1301,7 @@ void MainWindow::applyWebSettings()
|
||||||
{
|
{
|
||||||
QWebEngineSettings *defaultSettings = QWebEngineSettings::globalSettings();
|
QWebEngineSettings *defaultSettings = QWebEngineSettings::globalSettings();
|
||||||
defaultSettings->setAttribute(QWebEngineSettings::PluginsEnabled, cfg.preferences.enableWebPlugins);
|
defaultSettings->setAttribute(QWebEngineSettings::PluginsEnabled, cfg.preferences.enableWebPlugins);
|
||||||
|
defaultSettings->setAttribute(QWebEngineSettings::PlaybackRequiresUserGesture, false);
|
||||||
//defaultSettings->setAttribute( QWebEngineSettings::DeveloperExtrasEnabled, true );
|
//defaultSettings->setAttribute( QWebEngineSettings::DeveloperExtrasEnabled, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue