UserScripts Safari is a very useful and free script plug-in on Apple iOS, learn it in five minutes

JavaScript yyds. If you like to use Chrome for iOS, then you can also try to use proxy tools such as QuantumultX/Surge and the methods provided to embed JavaScript user scripts for specific web pages of the website to remove ads on web pages or speed up video ad skipping etc.; (see footnote to this article)

Introduction to UserScripts (iOS App)

Userscripts is a free iOS Safari  browser plug-in that is compatible with GreaseMonkey script, but it may not take effect if the GreaseMonkey script code is not adapted to the phone. Notice! This app needs to be used on iOS 15 and later versions

An open source userscript manager (for Safari); official project warehouse and introduction:  GitHub - quoid/userscripts: An open-source userscript manager for Safari 

Install and use UserScripts App

Official project repository and instruction
system support : iOS15+;
browser support : Safari extension;
official project open source repository : GitHub - quoid/userscripts: An open-source userscript manager for Safari ;
App : App Store search and download  UserScripts ; UserScripts ;
oil monkey Scripts : Greasy Fork - Safe and practical user scripts
to remove advertising plans Greasy Monkey script version : https://greasyfork.org/zh-CN/scripts/443290-adblock4limbo
 

 UserScripts for Safari graphic detailed steps

1. Search and install  UserScripts in the App Store ;

2. Open  the userscript  app and set the oil monkey script storage path - you can   delete the script in the file app ;

3. Open the iOS  Settings  App - find  the Safari browser  -  General  -  Extensions  -  Allow these extensions  - choose to enable Userscript;

4. Open the Safari browser and make sure the following settings are completed;

5. Officially install the (oil monkey) user script, and then reopen the userscripts in safari, you can see it

Or use the direct installation method to install (grease monkey) user script

6. View and open the newly installed script

7. To export the script in the computer, you can directly right-click the link to save the script js file at the install this script button

When you don't want to use the script, just go to the Userscript extension and close it;

VI. CONTENT EXAMPLE REFERENCE FOR CONTENT SCRIPT

// ==UserScript==
// @name         屏蔽内容农场(with 油猴脚本)
// @namespace    http://tampermonkey.net/
// @version      0.3.3
// @description  利用 JavaScript/CSS 屏蔽「内容农场」在谷歌搜索结果中的呈现,顺便在清除谷歌搜索结果中的Adsense广告,还你清爽的 Google 中文搜索体验!
// @author       limbopro
// @license MIT
// @match        https://www.google.com/search*
// @match        https://www.google.com.hk/search*
// @match        https://www.bing.com/search*
// @match        https://www.bing.com/?FORM*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=google.com.hk
// @run-at document-end
// @grant        none
// ==/UserScript==

// 动态创建并引入第三方脚本
var script = document.createElement("script");
script.src = 'https://limbopro.com/Adguard/contentFarm/contentFarm.js';
document.body.appendChild(script);

As above, the comments in the first half of the script are information that the user script manager can recognize : define, such as script name @name, script description @description, and which pages will take effect @match, etc.; for more information about user scripts Knowledge, please refer to the official document: Documentation | Tampermonkey  ; The second half of the script is the actual executable part of the JavaScript script, including some functions, methods, etc., to traverse the corresponding HTML elements, such as pictures, block-level elements, and compare them Perform exact matching, replacement, removal, etc.; friends who are interested in JavaScript (zero-based) can refer to: Squatting Reading - JavaScript  Tutorial , author Ruan Yifeng, very readable, basically understandable within half a day probably;

VII. Greasy Monkey Script Manager user script attribute value description

@name
脚本的名称。该项将显示在页面的标题以及链接内容,必填项。
@name:XX-YY
脚本在特定语言区域的标题。XX 指 ISO 639-1 国家代码 以及 YY 指可选的 ISO 3166 地区代码。该选项用于提供多语言的@name 脚本名称。
@description
脚本功能的描述,显示在脚本标题下面,必填项。
@description:XX-YY
用某门语言写成的脚本描述。XX 指 ISO 639-1 国家代码 以及 YY 指可选的 ISO 3166 地区代码。该选项用于提供多语言的@description 脚本介绍。
@namespace
@namespace 与 @name 这两个属性被作为脚本的唯一标识符,用户脚本管理器根据它们来判断一个脚本是否已安装。Greasy Fork 也需要这些属性,若用户在更新脚本时改变了两者中的任意一项,将发出警告。
@version
脚本的版本标记将使用 Mozilla 版本格式,并显示于脚本的简介页面。Greasy Fork 要求填写该属性,且当用户更新脚本时没有更新版本号或降低了版本号时将发出警告。
@include, @exclude, @match
描述脚本会在哪些网站上运行。该列表会被解析和展示到脚本的简介页面,并用于脚本的分类。每个脚本须有至少一个 @match 或 @include。了解格式细则。
@require
在您的脚本中引用其他外部脚本。请参见 包含外部脚本的使用规定。
@updateURL, @installURL, @downloadURL
告知用户脚本管理器应该在哪个地址获取脚本更新。Greasy Fork 将自动修改该属性使其永远通过 Greasy Fork 进行更新。
@license
许可证描述的是您是否允许别人以某些形式复制或修改您的脚本。建议从 SPDX 许可证列表 中选择「Full name」或「Identifier」填至此处。若您不提供许可证,则表示脚本仅允许个人使用且不得二次分发。许可证将在脚本的简介页面显示。
@supportURL
该脚本的技术支持链接(如:错误反馈系统、论坛、电子邮箱地址等),该链接将显示在脚本的反馈页面。
@contributionURL
用于捐赠脚本作者的链接,该链接将显示在脚本的反馈页面。网址可以为 http、https 或比特币协议的网址。如果您需要链接到贝宝捐赠页面,请使用例如 https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name=Greasy+Fork+donation 这样的格式,替换为您自己的邮箱地址即可。
@contributionAmount
建议捐赠金额,请配合 @contributionURL 使用。
@compatible
标记此脚本与某个浏览器兼容,兼容性信息将显示在脚本的简介页面上。您也可以添加额外的兼容说明,如 @compatible firefox 火狐上必须关闭广告过滤器 这样的格式。目前能被网站识别的浏览器名称有:firefox, chrome, opera, safari, edge。
@incompatible
标记此脚本与某个浏览器不兼容,兼容性信息将显示在脚本的简介页面上。您也可以添加额外的兼容说明,如 @incompatible firefox 自火狐 23 开始不兼容 这样的写法。目前能被网站识别的浏览器名称有:firefox, chrome, opera, safari, edge。
@antifeature
披露会为脚本作者而非用户带来额外收益的功能。你可以通过在脚本的元数据中添加 @antifeature type description 值的方法披露。其中type(类型)是必须填写的内容,而 description(描述)则可以留空。更多信息可以点击此处阅读 Greasy Fork 上关于 type的说明。
@antifeature:XX-YY
你可以使用多种语言声明 @antifeature 属性,其中 XX 为 ISO 639-1 中定义的两个字符的代码,而 YY 则是一个可选的 ISO 3166 中定义的国家代码。在@antifeature中制定的每一个类型都可以自定义其本地化的说明。

Tampermonkey user script manager uses the official documentation :
Documentation | Tampermonkey
greasyfork.org Documentation : (Including how to install, how to write user scripts): Site help  ;  Script meta property values ​​​​to be read by Greasy Fork  ;

Ad Blocking or JavaScript Study Guide

Official Website : Learn JavaScript Online - Courses for Beginners - javascript.com
JavaScript Tutorials : JavaScript Tutorials - Webway  (ready to read)
Modern JavaScript Tutorials : Modern JavaScript Tutorials
JavaScript Tutorials : JavaScript Tutorials | Novice Tutorials  (with testing tools)
Famous ad blocking extensions uBlock Origin provides some documentationHome · gorhill/uBlock Wiki · GitHub  such as scriptlets plugin etc.

Guess you like

Origin blog.csdn.net/weixin_44786530/article/details/129695622