Comments (10)
I just updated the JavaScript
codes above to show you how to spoof UA using the ChromeXt
API.
Note that it is impossible to spoof UA without using the ChromeXt
API.
from chromext.
I don't it is possible or good to do this with Xposed hooks.
Instead, you may consider check UA within your JavaScript codes. Here is an example taking from my own script:
const ua =
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114 Safari/537.36";
if (document.readyState == "loading") {
window.addEventListener("DOMContentLoaded", switchToDesktop);
} else {
switchToDesktop();
}
function switchToDesktop() {
if (
navigator.userAgent == ua &&
document.documentElement.className != "mobile-web-player"
) {
...
} else {
ChromeXt.dispatch("syncData", {
origin: window.location.origin,
data: ua,
name: "userAgent",
});
ChromeXt.dispatch("userAgentSpoof", window.location.href);
}
}
// vim: set expandtab: set tabstop=2:
from chromext.
我看到了项目里对于loadurlparams的hook代码,我只是好奇为什么对于初次加载页面时,尽管我对这个类里的ua参数进行hook,但是并不生效,只有在刷新时或者通过chromext使用js时才会生效
from chromext.
The Chromium
uses some lazy or cached logic to avoid parsing or analyzing LoadUrlParams
multiple times.
Therefore, we can only hook UA when Chromium
is not using cached parameters.
from chromext.
我大概了解了,感谢!
from chromext.
Hey bro,there is something wrong with my js code. Here is my code : https://greasyfork.org/zh-CN/scripts/482653-hidefingerprintforchromext/code
from chromext.
Please refer to the docs in README: https://github.com/JingMatrix/ChromeXt?tab=readme-ov-file#supported-api
You need to add @grant GM.ChromeXt
.
from chromext.
现在加上了,但是在chrome的sp文件夹下没有发现useragent.xml被创建(但是我可以通过在kotlin层创建自定义的useragent.xml来实现ua伪装,只不过此时创建貌似时机不太对),我对js不太熟悉,抱歉:(
from chromext.
I cannot understand the description of your situation.
Moreover, you should clarify the folder or file locations you are referring to.
If the GM.ChromeXt
API is not working as expected, please open an new issue and present how to reproduce it.
I am using ChromeXt
API everyday and always using UserAgent Spoof endpoint, it is not likely to be a bug of the project. Better double check your JavaScript codes.
from chromext.
好的,我再检查一下吧
from chromext.
Related Issues (20)
- Crash on Chrome 121.0.6167.102 HOT 1
- Support for Edge / Chrome 123 HOT 4
- content cosmetic blocker & CSP Rules don't affect background tabs HOT 7
- Crashing in the latest version of edge. HOT 4
- Frequent crash on Vivaldi Browser HOT 4
- Crash on Samsung Internet HOT 15
- Support Qihoo browser HOT 4
- Regarding the issue of full screen gesture return for lspatch (non white screen and non flashing version)关于lspatch(不白屏不闪退版)的全面屏手势返回问题 HOT 2
- Unable to install UserScripts (without Eruda) in Edge v122 HOT 5
- Simplified view in Kiwi Browser HOT 1
- Bengali Font bug in Simplified View of Kiwi Browser HOT 1
- Adapt general WebView applications to ChromeXt HOT 8
- Eruda console option not showing up on Brave Browser HOT 2
- ChromeXt front-end for multiple browsers HOT 12
- Fix support for Naver Whale Browser 3.2.1.2 and later HOT 1
- Third party download managers HOT 1
- Lspatch release in github action has expired. HOT 1
- Unable to patch brave browser using lspatch manager apk. HOT 3
- ChromeXt does not work on Samsung SM-G9500 with LSPosed v1.9.2 HOT 1
- 请求支持enkbro浏览器 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 chromext.