首页 > 解决方案 > 这个 Safari Blocker 正则表达式有什么问题?

问题描述

我正在开发一个 Safari 扩展程序( Safari 文件夹中的https://github.com/bcye/Hello-Goodbye)并试图阻止聊天小部件。

我试图阻止(在 Chrome 扩展语法中)*://widget.intercom.io/*

所以我试图阻止 http 或 https 以及 widget.intercom.io 上的任何路径

我尝试了这两个 Safari 拦截器正则表达式(文档:https ://developer.apple.com/documentation/safariservices/creating_a_content_blocker ):

https?:\/\/widget\.intercom\.io\/(.*) https?://widget\.intercom\.io/.

两者都不起作用。

我尝试在https://regex101.com/上调试它们,它告诉我第一个应该可以工作。

链接到 regex101:https ://regex101.com/r/N3jUdW/1

标签: swiftregexsafarisafari-extension

解决方案


推荐阅读