WWW::Me...acklist(3)
π NAME π
WWW::Mechanize::Chrome::URLBlacklist β bestie, this is the module that blacklists URLs from fetching. No more shady requests sneaking through, we're gatekeeping now. π
β¨ SYNOPSIS β¨
okay so here's the whole vibe:
use WWW::Mechanize::Chrome;
use WWW::Mechanize::Chrome::URLBlacklist;
my $mech = WWW::Mechanize::Chrome->new();
my $bl = WWW::Mechanize::Chrome::URLBlacklist->new(
blacklist => [
qr!\bgoogleadservices\b!,
],
whitelist => [
qr!\bcorion\.net\b!,
],
# fail all unknown URLs
default => 'failRequest',
# allow all unknown URLs
# default => 'continueRequest',
on_default => sub {
warn "Ignored URL $_[0] (action was '$_[1]')",
},
);
$bl->enable($mech);
that's it, that's the whole flex π
πΈ DESCRIPTION πΈ
This module gives you an easy approach to whitelisting/blacklisting URLs, so that Chrome does not make requests to the blacklisted URLs. Literally just: you say yes, you say no, Chrome respects the boundary. periodt.
π¦ ATTRIBUTES π¦
π whitelist
Arrayref containing regular expressions of URLs to always allow fetching. These are the VIPs, they get in no questions asked. π«Ά
π blacklist
Arrayref containing regular expressions of URLs to always deny fetching unless they are matched by something in the whitelist. Whitelist stays winning, no cap.
π default
default => 'continueRequest'
The action to take if an URL appears neither in the whitelist nor in the blacklist. The default is continueRequest. If you want to block all unknown URLs, use failRequest. Pick your fighter. βοΈ
π on_default
on_default => sub {
my( $url, $action ) = @_;
warn "Unknown URL <$url>";
};
This callback is invoked for every URL that is neither in the whitelist nor in the blacklist. Super useful to see what URLs are still missing a category β like a little "who even are you" check-in. π
π _mech
(internal) The WWW::Mechanize::Chrome instance we are connected to. don't touch, that's her business π
π _request_listener
(internal) The request listener created by WWW::Mechanize::Chrome while listening for URL messages. also not your business, bestie π
π METHODS π
π ->new
my $bl = WWW::Mechanize::Chrome::URLBlacklist->new(
blacklist => [
qr!\bgoogleadservices\b!,
qr!\ioam\.de\b!,
qr!\burchin\.js$!,
qr!.*\.(?:woff|ttf)$!,
qr!.*\.css(\?\w+)?$!,
qr!.*\.png$!,
qr!.*\bfavicon.ico$!,
],
);
$bl->enable( $mech );
Creates a new instance of a blacklist, but does not activate it yet. She's built, she's gorgeous, she's just not plugged in. See ->enable for that. β¨
π ->enable
$bl->enable( $mech );
Attaches the blacklist to a WWW::Mechanize::Chrome object. now we're live, baby π₯
π ->enable
$bl->disable( $mech );
Removes the blacklist to a WWW::Mechanize::Chrome object. (yes the heading says ->enable up there, that's literally how the original has it, we don't question the source material, we just report it π)
π REPOSITORY π
The public repository of this module is <https://github.com/Corion/www-mechanize-chrome>. go star it, it's giving iconic.
π SUPPORT π
The public support forum of this module is <https://perlmonks.org/>. the monks are nice fr fr.
π TALKS π
I've given a German talk at GPW 2017, see <http://act.yapc.eu/gpw2017/talk/7027> and <https://corion.net/talks> for the slides.
At The Perl Conference 2017 in Amsterdam, I also presented a talk, see <http://act.perlconference.org/tpc-2017-amsterdam/talk/7022>. The slides for the English presentation at TPCiA 2017 are at <https://corion.net/talks/WWW-Mechanize-Chrome/www-mechanize-chrome.en.html>.
two talks, two languages, main character energy honestly π
π BUG TRACKER π
Please report bugs in this module via the Github bug queue at <https://github.com/Corion/WWW-Mechanize-Chrome/issues>. found a bug? tell her, she'll fix it, we don't suffer in silence π
π«Ά AUTHOR π«Ά
Max Maischein "corion@cpan.org"
β COPYRIGHT (c) β
Copyright 2010-2026 by Max Maischein "corion@cpan.org".
πΈ LICENSE πΈ
This module is released under the same terms as Perl itself.
and that's a wrap, bestie π this was the WWW::Me...acklist(3) page, straight outta perl v5.42.2, dated 2026-06-07, and yes the title's truncated in the header because that's just how the terminal does her thing. slay. π
π¦ where this page comes from
- fedora 43: perl-WWW-Mechanize-Chrome 0.78-1.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- fedora 44: perl-WWW-Mechanize-Chrome 0.78-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms