
Source (link to git-repo or to original if based on someone elses unmodified work):
Available as/for:
Description:It's a window on the web. Like a browser, but without controls, and with static URLs (defined in the prefs) to load from.
It's a cheap way of creating plasmoids from webpages !
If you know ways of helping me building this plasmoid, please go to the Github page ! Also, go to Transifex to help me with the translations ! https://www.transifex.com/cqoicebordel/webslice
Note that you may need to install qml-module-qtwebview or qt5-webview for it to work.
Also, some settings are fiddly. It's known. You may have to jiggle them a bit, or refresh the page.
If you are on 19.04 or older, please keep using the legacy version.
What is in :
- Loading a page
- Setting the URL in the prefs
- Auto refresh from conf in prefs
- Zoom
- Choose your background color
- Context menu to manually reload the page
- Context menu to open page, or links in default browser
- A way of automatically scroll to a part of the page
- Inject your own JS in the page
- Show or hide the scrollbars
- Use as a taskbar plasmoid
- Configure from context menu
- Choose compact or full layout
- Choose size of popup
- Keep the popup pinned open
- More URLs through context menu
- Middle click or ctrl+click links to open them in default browser
- Shortcuts (experimental)
- Fill the space (experimental)
- I18n (en+fr+nl+ru+zh_TW+es)
TODO :
- Moar languages !
- ...
Version 2.5, 2024/01/05 Fixes for Plasma 5.26
The popup size on Plasma 5.26 has been fixed by @ilarth. Thanks a bunch !
Also, the empty webslice at startup, when displaying the site directly has been fixed.
This version should still work on previous versions of Plasma.
Ratings & Comments
92 Comments
10 Works great and has plenty of options.
10 This is great! Is there any way this could handle push notifications and maybe even PWA/sites metadata? (Like number of messages or new updates from the site)
Thanks ! For push notifications, it might be possible, but right now, I have no idea how I could implement them. At all. For PWA, I think they are not necessary, as webslice is here to mimick a PWA. You can even have a static profile so data is retained (in the experimental settings). But in both cases, an always running thread would be necessary, to receive the notification/keep the PWA alive. And I don't think it's a good idea in the case of webslice. I'm not saying I will never do it. But it clearly won't happen for a long time, at least.
9 9/10, just wish there was a way to load css (something like stylus), sadly I have not found a solution in js to load css yet.
Found a way, but not sure how I will work it out as I cannot load js from a file.
There is a way to load CSS ! In the "advanced" settings of the plasmoid, in the JS area at the bottom, you can put ``` var css = "Paste your rules here"; var node = document.createElement("style"); node.type = "text/css"; node.appendChild(document.createTextNode(css)); var heads = document.getElementsByTagName("head"); if (heads.length > 0){ heads[0].appendChild(node); }else{ document.documentElement.appendChild(node); } ``` You just have to copy-paste all the rules of your .css file in the 'css' variable :)
Sorry, the newlines are not taken into account here :/
Thanks for the reply. That did not seem to do it, my other one didn't either. Yours: var css = "ytd-watch-flexy[theater] #player-theater-container.ytd-watch-flexy, ytd-watch-flexy[fullscreen] #player-theater-container.ytd-watch-flexy { height: 100vh; max-height: 100vh; } ytd-watch-flexy:not([fullscreen])[theater] #player.ytd-watch { max-height: 100vh; } ytd-watch[theater] #player.ytd-watch { width: 100%; max-height: 100vh; } #masthead-container.ytd-app { opacity: 0 !important; transition: opacity 0.2s ease-in-out; } #masthead-container.ytd-app:hover { opacity: 1 !important; } /* Hide feedback and restore classic buttons */ #extra-buttons.ytd-app { display: none !important; } /* Fix toast interfering with controls */ #toast.ytd-app:not(.paper-toast-open) { pointer-events: none; } #page-manager.ytd-app { margin-top: 0px; }"; var node = document.createElement("style"); node.type = "text/css"; node.appendChild(document.createTextNode(css)); var heads = document.getElementsByTagName("head"); if (heads.length
I'm sorry, I can't debug the code you are using at distance, especially since it looks like it's cut in your comment. The code I gave works for me. Beyond that, I can't do anything, especially since Youtube is a mess of a site. Sorry.
Yeah, that is all good. I was just letting you know neither worked. If I figure it out I could always just let you know. It is just hard with no inspect menu (F12). Love the plasmoid though :D
Thanks !
10 Great job man. Is there a way to reduce/remove that (ugly) plasmoid border?
Good question. I don't think it's possible. It seems to follow the theme used, so maybe it can be handled at the Plasma level. But I'll definitely take a look, just in case :)
hey. this bothered me too and the "fix" is quite simple.. just put this line in main.qml: Plasmoid.backgroundHints: PlasmaCore.Types.NoBackground
10 Cqoi, you've done a fantastic job on the Webslice applet. This is a new indispensable must-have widget for me. Thank you!
Thank you !
I haven't changed the background color. I applied the change in main.qml but no change. But please don't get stressed about me. I have time :)
10 Since the upgrade to Kubuntu 21.04, the plasmoid only shows a white image. In the default setting, you can also briefly see the default page. Then it will be reloaded after a short time and everything is white and remains white.
Ah shit. I'm not on Kubuntu 21.04 and wasn't planning to switch to it, and to stay on LTS. I'll have to spin up a VM. But my hardware is too old for virtualization :/ I have no idea what could cause that issue. I have two possible things that come to mind : if you change the color of the background of the plasmoid, does it improve or worsen the issue ? And if you are willing to test, could you edit `~/.local/share/plasma/plasmoids/cqcb.plasma.webslice/contents/ui/main.qml` to change `import QtWebEngine 1.8` to `import QtWebEngine 1.10` Then, restart plasmashell (pkill plasmashell && plasmashell), and, again, does it improve or worsen the situation ? In any case, I'll eventually investigate the issue, but I can't promise when :/
I haven't changed the background color. I applied the change in main.qml but no change. But please don't get stressed about me. I have time :)
Thank you for your understanding :)
10 10 the best
8 Thanks for this plugin, it is extremely useful! :-) What is the desired way to open links from the displayed page in the default browser (outside of the plugin)? Some weeks ago, it was possible to click with the middle mouse button on a link and it opened in the default browser (outside of the plugin). This seems not to work anymore. Now a middle click causes a delay of several seconds before the same page opens in the default browser.
It's weird. I didn't touch anything on middle click for a long while now. Maybe it's the way the default browser is detected in Qt that create a problem. Honestly, I really don't know. At least, it opens, eventually :/ If anyone has an idea, I'll take it.
Is it possible to change zoom factor to more flexible values? I need something between 0.5x and 0.75x and currently I have to ctrl+wheel_up (it's strange that qtwebengine still allows you to do that) for that very state after every reload.