Skip to content

Commit

Permalink
bundle v2
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviotordini committed Nov 30, 2020
1 parent c39c663 commit 2bfb409
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/httputils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,10 @@ const QByteArray &HttpUtils::userAgent() {
}();
return ua;
}

const QByteArray &HttpUtils::stealthUserAgent() {
static const QByteArray ua =
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like "
"Gecko) Chrome/84.0.4147.105 Safari/537.36";
return ua;
}
1 change: 1 addition & 0 deletions src/httputils.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class HttpUtils {
static Http &cached();
static Http &notCached();
static const QByteArray &userAgent();
static const QByteArray &stealthUserAgent();

private:
HttpUtils() {}
Expand Down
4 changes: 3 additions & 1 deletion src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ MainWindow::MainWindow() : toolbarMenu(nullptr), mainToolBar(nullptr) {
}

void MainWindow::lazyInit() {
JS::instance().initialize(QUrl(QLatin1String(Constants::WEBSITE) + "-ws/bundle.js"));
JS::instance().getNamFactory().setRequestHeaders(
{{"User-Agent", HttpUtils::stealthUserAgent()}});
JS::instance().initialize(QUrl(QLatin1String(Constants::WEBSITE) + "-ws/bundle2.js"));

GlobalShortcuts &shortcuts = GlobalShortcuts::instance();
#ifdef APP_MAC
Expand Down

0 comments on commit 2bfb409

Please sign in to comment.