Skip to content

Instantly share code, notes, and snippets.

@Katarn
Created March 14, 2014 15:54
Show Gist options
  • Save Katarn/9550536 to your computer and use it in GitHub Desktop.
Save Katarn/9550536 to your computer and use it in GitHub Desktop.
diff --git a/resources/resources.qrc b/resources/resources.qrc
index d7464bd..70c7468 100644
--- a/resources/resources.qrc
+++ b/resources/resources.qrc
@@ -89,5 +89,6 @@
<file>files/start.html</file>
<file>schemas/bookmarks.sql</file>
<file>other/userAgents.ini</file>
+ <file>javascript/middle-button-scroll.js</file>
</qresource>
</RCC>
diff --git a/src/modules/backends/web/qtwebkit/QtWebKitWebWidget.cpp b/src/modules/backends/web/qtwebkit/QtWebKitWebWidget.cpp
index 219cf94..9eb735d 100644
--- a/src/modules/backends/web/qtwebkit/QtWebKitWebWidget.cpp
+++ b/src/modules/backends/web/qtwebkit/QtWebKitWebWidget.cpp
@@ -269,6 +269,13 @@ void QtWebKitWebWidget::pageLoadFinished(bool ok)
}
}
+ QFile file(QLatin1String(":/javascript/middle-button-scroll.js"));
+ file.open(QIODevice::ReadOnly | QIODevice::Text);
+
+ QTextStream stream(&file);
+ QString content = stream.readAll();
+
+ m_page->mainFrame()->evaluateJavaScript(content);
emit loadingChanged(false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment