-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Urls not listed in filter still pass through? #2
Comments
@coodoo What version of Nightmare and nightmare-load-filter are you using, out of curiosity? I tried your example, and if you add logging in the filter callback, it doesn't look like it gets called. How are you asserting that the image is getting blocked? (The URL provided returns a 502.) |
@rosshinkley I'll provide detailed report soon, quick question: how do I log in the filter callback? I tried the standard |
Here's a short code sample to reproduce the issue, const rules = [
'google.com',
// 'edgesuite.net'
]
this.browser
.filter( { urls: rules }, ( details, cb ) => cb({ cancel: details.url.indexOf('edgesuite.net') != -1 }) )
.goto( 'http://www.appledailytw.com/realtimenews/article/nextmag/20160531/874328/' ) Using:
|
Output will be a part of the Electron
That's odd. Maybe this is a quirk of later versions of Electron or Chromium - I would expect whole matches (eg, It looks like it works as expected if you are willing to use wildcards. Your example, slightly modified: const rules = [
'http://google.com/*',
// 'edgesuite.net'
]
this.browser
.filter( { urls: rules }, ( details, cb ) => cb({ cancel: details.url.indexOf('edgesuite.net') != -1 }) )
.goto( 'http://www.appledailytw.com/realtimenews/article/nextmag/20160531/874328/' ) |
Very interesting findings! After playing with it a bit more I found the url must contain |
That doesn't surprise me as much: |
First of all thanks for making all these great things happen, big kudos!
Just did a quick run and seemed urls not listed in the
filter
still got passed to thefn
.See below,
edgesuite.net
is not listed in the filter I would assume it shouldn't got passed intofn
at all, am I doing something wrong here?The text was updated successfully, but these errors were encountered: