- read this first: https://www.webkit.org/blog/3476/content-blockers-first-look/
- start by adding a new extension target to your iOS app of type “content blocker”
- launch the app using the main target’s scheme + a call to
SFContentBlockerManager.reloadContentBlockerWithIdentifier()
with the extension’s id inapplication:didFinishLaunchingWithOptions:
to auto-reload the blocker in development mode - if you don’t call
reloadContentBlockerWithIdentifier()
then you need to switch the blocker off and on again in the Safari settings (stop the app in Xcode if the switch is not moving) - use inspector from desktop Safari to inspect the Safari in the simulator in order to find specific things to block
- things like periods in the
url-filter
regexp need to be escaped with double backslashes, e.g.facebook\\.net
- if you use
if-domain
, it needs to be an array, even for one element - domain
foo.com
might not matchwww.foo.com
even though I think it’s supposed to (UPDATE: They've changed it in one of
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bb.cascades 1.0 | |
Page { | |
content: Container { | |
Label { | |
id: emailLabel | |
text: qsTr("Email") | |
} | |
Label { | |
id: urlLabel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ignore: avoid_web_libraries_in_flutter | |
import 'dart:html'; | |
import 'dart:ui' as ui; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(WebcamApp()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ignore: avoid_web_libraries_in_flutter | |
import 'dart:html'; | |
import 'dart:ui' as ui; | |
import 'package:flutter/material.dart'; | |
void main() => runApp(WebcamApp()); | |
class WebcamApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) => MaterialApp( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MIT License | |
// | |
// Copyright (c) 2020 Simon Lightfoot | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MIT License | |
// | |
// Copyright (c) 2020 Simon Lightfoot | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MIT License | |
// | |
// Copyright (c) 2020 Simon Lightfoot | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MIT License | |
// | |
// Copyright (c) 2020 Simon Lightfoot | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:math' show Random; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart' show RendererBinding; | |
void main() { | |
runApp(MaterialApp( | |
home: Home(), | |
)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:math' as math; | |
import 'dart:ui' as ui; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
const kBarWidth = 72.0; | |
const kBarSpacing = 4.0; | |
const kLabelHeight = 32.0; |