Comments (8)
这个是根据浏览器的User Agent来判断是桌面还是手机,然后写入cookie。
只要cookie里面 trilium-device=mobile 就是移动版界面, trilium-device=desktop就是桌面版界面。
from trilium-translation.
写了一个简单的js, 移动端打开页面时设置cookie, 这样一直都是桌面版界面
from trilium-translation.
大佬666。
我试了一下,手机端登录之后似乎需要刷新一次这个脚本才会生效(已设置#run=mobileStartup,用的edge浏览器已清除旧cookie),这个是浏览器或者我的server的问题吗?
还有一个小白问题,就是我希望能够在手机端登录、用你的脚本自动切换到桌面端后,自动Toggle Mobile View,从而节省一次点击也少占一个launcher,但是这个脚本和SetHTMLMeta、SetNoteView我设置了#run=mobileStartup后好像也没有生效(刷新网页后没有生效),是我哪里弄错了吗?
from trilium-translation.
把那些js代码复制到我那个js下面试试
from trilium-translation.
我把来自Toggle Mobile Vew的相关代码复制到了你的always desktop mod
下方:
var viewport = document.createElement('meta');
viewport.name = 'viewport';
viewport.content = 'width=device-width, initial-scale=1.0'
document.head.appendChild(viewport);
$('body').toggleClass("mobile-view");
$('body').attr("current-view", "sidebar");
并且把相关原js笔记都设置为了#disabled:run,但好像没有效果。还有需要刷新才能进入桌面版的问题,要是没有直接的解决方案就先搁置算了,以后我慢慢钻研
from trilium-translation.
Mobile View问题解决了!原来是应该用#run=frontendStartup而非mobileStartup,因为你的操作生效之后实际上就是桌面版了。然后我在想不管出于什么原因导致我需要刷新一次你的脚本才能生效,有没有api可以直接实现reloadFrontendApp
的好加在你的代码最后,相当于直接自动刷新一次?
from trilium-translation.
直接刷新整个页面?
location.reload();
from trilium-translation.
直接刷新整个页面?
location.reload();
有效!谢谢佬
from trilium-translation.
Related Issues (20)
- 关于v0.63.5客户端在win11中无法运行的问题 HOT 2
- trilium客户端如何更改服务端地址 HOT 5
- 关于字体的一个建议 HOT 1
- yml启动失败 HOT 6
- AUR包是否应当改名为trilium-cn-bin? HOT 1
- Calendar Page和Timetable无法使用 HOT 1
- 能否为Linux桌面版本制作AppImage包 HOT 3
- 中文月份排序优化 HOT 4
- 求教如何编译apple m1 arm64 版本。 HOT 3
- maybe it is a problem? HOT 2
- 大佬,请教如何设置,可以打开一个新标签页,期望是点击某个笔记,例如notes显示新建标签页。这个页面可以通过renderNote设置出来吗? HOT 4
- 有关于LOG和终端输出建议
- docker compose部署支持修改成https吗 HOT 3
- 添加字体 HOT 1
- 您好,我想请教一下在不应用纯文本的情况下取消段落缩进操作呀,只要回车就自动缩进了,然后如果想缩进只能跑到上一行末尾... HOT 5
- 您好,我想请教一下在不应用纯文本的情况下取消段落缩进操作呀,只要回车就自动缩进了,然后如果想缩进只能跑到上一行末尾...
- 群晖版本的docker怎么安装? HOT 1
- 从服务器同步遇到问题 HOT 3
- 关于更新软件后的数据转移 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trilium-translation.