A practical chrome tool: xtrace

Time:2021-1-13

Difficulty: easy

preface

When we browse the Internet, we are often collected by websites. The collection behavior itself is not a problem, but some websites often need to click such interactive behaviors as “download app to read more” or “note that bloggers can read the full text” in order to drain or attract registration to the mobile terminal, which greatly affects the reading experience

A practical chrome tool: xtrace

I think many students often encounter the above example, which is very bad in the reading experience. It is unacceptable to interrupt our daily work process, interrupt our development ideas, and waste our time. In view of this, I develop a chrome plug-in xtrace to screen them. The basic principle is to use these blog posts to do SEO, and the page is basically SSR The function of covering part of the content is basically realized through the front-end JS script, so as long as the script execution is blocked.

How to use xtrace?

xTrace

Xtrace is a Chrome extension, which is used to shield some scripts that track user behavior, as well as front-end scripts that support user-defined shielding and affect our smooth reading of blog posts.

How to install

Mode 1: online installation
Users can install online through the Chrome web store. Here isDirect link

The plug-in can be automatically obtained by online installation(xTrace)Function update

Mode 2: offline installation

  1. downloadGitHub source codeTo the user’s local computer
  2. Open chrome, enter the extender management interface, and openDeveloper mode
  3. clickLoad the unzipped extender, select thesrcDirectory and load
  4. Installation successful

Offline installation can’t get function update automatically. You need to download the source code and load it again

usage method

Using the mouseLeft clickExpand the program icon, click in the pop-up pageOptionsEnter the configuration page, where users can configure more customized script interception,

A practical chrome tool: xtrace

xTraceThe following interception rules are built in:

://hm.baidu.com/
://www.google-analytics.com/
://www.googletagmanager.com/
://my.openwrite.cn/
://pagead2.googlesyndication.com/
://adservice.google.com
://csdnimg.cn/release/blogv2/dist/pc/js/detail

Interception effect:

A practical chrome tool: xtrace

Interception example

Open the following link:

Not installed inxTraceWhen expanding the program, we can only read the part. We need to pay attention to the blogger or register before we can continue to read. The screenshot is as follows:
A practical chrome tool: xtrace

On installationxTraceAfter extending the program, we can read the full text. The screenshot is as follows:
A practical chrome tool: xtrace

Additional features

xTraceCan also be used to block specific advertising links, although the market has many similarAdBlockThe plug-ins to screen ads, but the effect is not very good, many websites will also do anti shielding against these plug-ins.xTraceIt’s much simpler. It directly blocks the domain names or script links that load ads. at present, plug-ins have built-in common domain names and links. If you find more ad domain names, you canissueCome and tell me.

Harmonious society, you and I build together!

more

Chrome plug in source code installation / offline installation

  1. Because of the existence of GFW in China, if there is no ladder, you can only choose Offline Mode to install chrome plug-ins. Here is an offline installation method (it seems to be the only way at present)
  2. Find a domestic chrome plug-in image station and download the offline package CRX. If you can’t find the image, please refer to the reference link at the end of the article
  3. The CRX extension file of the latest version of chrome (after 67) cannot be directly dragged and installed. You can choose to decompress and install the source code or open the developer mode
  4. Changing the extension of CRX file to zip under MAC does not support double-click decompression. You can execute commands in the terminalunzip xxx.crx -d xxxComplete decompression to obtain the source code
  5. Under windows, CRX can be directly extracted by 7zip tool to obtain the source code of the installation package
  6. After getting the source code, open chrome and enter it in the address barchrome://extensions/, openDeveloper mode, clickLoad the unzipped extenderButton, load the source directory to complete the installation

reference resources

Quick start to chrome plug-in development:https://zhuanlan.zhihu.com/p/…

Official document of chrome plug-in development:https://developer.chrome.com/…

Domestic chrome plug-in image stations:https://pictureknow.com/exten…

Recommended Today

General method of Tkinter (21) components

method explain after(delay_ms, callback=None, *args) At least delay_ Ms after calling callback, no callback, equivalent time.sleep (); returns an ID to cancel after_ The cancel () method uses after_cancel(id) Cancel the callback of after method call after_idle(func, *args) Similar to the after method, but called when there is no event idle bell() A beep bind(sequence=None, […]