Skip to content

Commit

Permalink
ota-24
Browse files Browse the repository at this point in the history
  • Loading branch information
mateosalta committed Nov 25, 2022
1 parent c7c7149 commit a81b966
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 22 deletions.
28 changes: 14 additions & 14 deletions app/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,17 @@ Rectangle {

id: rect
visible: true
color: "#111111"

color: "transparent"

ScreenSaver {
id: screenSaver
screenSaverEnabled: !Qt.application.active || !webview.recentlyAudible
}


width: units.gu(45)
height: units.gu(75)


objectName: "mainView"
property bool loaded: false

Expand All @@ -35,32 +34,32 @@ Rectangle {
property alias dataPath: webContext.persistentStoragePath

dataPath: dataLocation

userScripts: [
userScripts: [
WebEngineScript {
id: cssinjection
injectionPoint: WebEngineScript.DocumentReady
worldId: WebEngineScript.UserWorld
sourceCode: "\n(function() {\nvar css = \"* {font-family: \\\"Ubuntu\\\" !important; font-size: 10pt !important;} ytm-pivot-bar-renderer {display: none !important;}\"\n\n;\n\n\nif (typeof GM_addStyle != \"undefined\") {\n\tGM_addStyle(css);\n} else if (typeof PRO_addStyle != \"undefined\") {\n\tPRO_addStyle(css);\n} else if (typeof addStyle != \"undefined\") {\n\taddStyle(css);\n} else {\n\tvar node = document.createElement(\"style\");\n\tnode.type = \"text/css\";\n\tnode.appendChild(document.createTextNode(css));\n\tvar heads = document.getElementsByTagName(\"head\");\n\tif (heads.length > 0) {\n\t\theads[0].appendChild(node); \n\t} else {\n\t\t// no head yet, stick it whereever\n\t\tdocument.documentElement.appendChild(node);\n\t}\n}\n\n})();"
}
]

httpUserAgent: "Mozilla/5.0 (Linux; Android 11; Ubuntu Touch) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Mobile Safari/537.36"
httpUserAgent: "Mozilla/5.0 (Linux; Android 12; Ubuntu Touch) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Mobile Safari/537.36"
}

WebView {

id: webview

anchors.fill: parent
backgroundColor: "#111111"
anchors.fill: parent
backgroundColor: "transparent"
url: "https://m.youtube.com/"



profile: defaultProfile
settings.fullScreenSupportEnabled: true
settings.dnsPrefetchEnabled: true
settings.showScrollBars: false
// settings.showScrollBars: false

enableSelectOverride: true

Expand Down Expand Up @@ -164,7 +163,7 @@ Rectangle {
}
}

RadialBottomEdge {
RadialBottomEdge {
id: nav
visible: rect.loaded
actions: [
Expand Down Expand Up @@ -233,8 +232,7 @@ Rectangle {
}
]
}



Rectangle {
id: splashScreen
color: "#111111"
Expand Down Expand Up @@ -263,6 +261,8 @@ Rectangle {
}




Connections {
target: webview

Expand Down
20 changes: 16 additions & 4 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,35 @@ int main(int argc, char** argv) {
QGuiApplication::setOrganizationName("youtube-web.mateo-salta");
QGuiApplication::setApplicationName("youtube-web.mateo-salta");
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
//QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);

//qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "");
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);

// qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "true");

if (qgetenv("QT_QPA_PLATFORM") == "wayland") {
qputenv("QT_WAYLAND_SHELL_INTEGRATION", "wl-shell");
qputenv("QT_SCALE_FACTOR", "1.7");
qputenv("QT_WEBENGINE_DISABLE_GPU","1");
}

QGuiApplication app(argc, argv);
const auto chromiumFlags = qgetenv("QTWEBENGINE_CHROMIUM_FLAGS");
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", chromiumFlags + " --enable-features=OverlayScrollbar,OverlayScrollbarFlashAfterAnyScrollUpdate,OverlayScrollbarFlashWhenMouseEnter,PictureInPicture --enable-smooth-scrolling --enable-low-res-tiling --enable-gpu --ignore-gpu-blocklist --enable-gpu-rasterization --force-gpu-rasterization --enable-zero-copy --adaboost --enable-gpu-memory-buffer-video-frames --double-buffer-compositing --enable-native-gpu-memory-buffers --font-render-hinting=none --disable-font-subpixel-positioning --disable-new-content-rendering-timeout --enable-defer-all-script-without-optimization-hints --gles-egl --disable-frame-rate-limit --disable-gpu-vsync --enable-oop-rasterization --enable-accelerated-video-decode --use-angle=gles --enable-es3-apis --enable-accelerated-2d-canvas");

// qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--blink-settings=darkMode=3,darkModeImagePolicy=2,darkModeImageStyle=2 --enable-smooth-scrolling --enable-low-res-tiling --enable-low-end-device-mode --enable-natural-scroll-default");
//qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "");


QGuiApplication app(argc, argv);


// QQmlApplicationEngine engine;
//engine.load(QUrl(QStringLiteral("qrc:///app/Main.qml")));

QQuickView view;
view.setFlags(Qt::Window | Qt::WindowTitleHint);
view.setResizeMode(QQuickView::SizeRootObjectToView);
view.setColor(Qt::black);
view.setSource(QUrl("qrc:///app/Main.qml"));
view.show();

return app.exec();
}
1 change: 0 additions & 1 deletion main.qrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/">
<file>app/Main.qml</file>

<file>app/UCSComponents/EmptyState.qml</file>
<file>app/UCSComponents/RadialAction.qml</file>
<file>app/UCSComponents/RadialBottomEdge.qml</file>
Expand Down
4 changes: 2 additions & 2 deletions manifest.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"urls": "youtube-web.url-dispatcher"
}
},
"version": "5.2.2",
"version": "6.2.0",
"maintainer": "Mateo Salta <mateo_salta@yahoo.com>",
"framework" : "ubuntu-sdk-16.04.5"
"framework" : "ubuntu-sdk-16.04.7"
}

2 changes: 1 addition & 1 deletion youtube-web.desktop.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Name=YouTube
Comment=Morph based alternate Youtube Webapp
Exec=youtube-web --enable-embedded-switches %U
Exec=youtube-web %U
Terminal=false
Type=Application
Icon=assets/icon.png
Expand Down

0 comments on commit a81b966

Please sign in to comment.