Post Reply 
Suggestion: remove links to ads
Jul. 28, 2006, 01:28 AM
Post: #16
RE: Suggestion: remove links to ads
Odyssey, much thanks for support. I can confirm that what you described - navigation by switching the window, so to speak - is 100% the case here as well. I think the logical next step is lobbying for teaching bfilter to remove all links from the window once the window loses focus, what do you think? some deactivate event... (just kidding).

Jart, thank you very much for your decision!

Vadim Rapp
Add Thank You Quote this message in a reply
Aug. 29, 2006, 06:43 PM
Post: #17
RE: Suggestion: remove links to ads
I implemented the page_cleanup option.
I've made a build for people to test it:
http://www.tts.lt/~joseph/bfilter-1.0.6pre-install.exe

This option is documented in config.default.
Add Thank You Quote this message in a reply
Aug. 30, 2006, 06:36 AM
Post: #18
RE: Suggestion: remove links to ads
If you are going to revise BFilter anyway, would you please get rid of auto-meta-refresh? Pages that refresh the same content at intervals are just plain annoying.
Add Thank You Quote this message in a reply
Aug. 30, 2006, 07:15 AM
Post: #19
RE: Suggestion: remove links to ads
It can be done with a custom filter, but disabling meta-refresh completely is probably a bad idea, because it's commonly used for downloads. When you see something like "Your download will begin shortly", there is a good chance it's implemented with meta-refresh.
Add Thank You Quote this message in a reply
Aug. 31, 2006, 06:31 AM
Post: #20
RE: Suggestion: remove links to ads
I don't mean disable all meta-refresh, just the auto refresh that simply rewrites the same page again. It is very annoying when one is in the middle of reading the page.
Add Thank You Quote this message in a reply
Aug. 31, 2006, 08:00 AM
Post: #21
RE: Suggestion: remove links to ads
I think it's best to write such filters on per-URL basis. Another idea is to write a JavaScript-driven filter to check the timeout value, and if it's high enough (say > 30 sec), then remove the meta refresh tag. If you ask me nicely, I can write such a filter for you.

As for using refresh-to-same-url factor, there are two problems with it:
1. In BFilter, filters don't have access to the current page URL.
2. Some sites would add things like &nocache=random_number to urls.
Add Thank You Quote this message in a reply
Sep. 01, 2006, 06:46 AM
Post: #22
RE: Suggestion: remove links to ads
Could you write such a filter, say, looking for a frequency of refresh greater than once every 15 minutes? Pretty please?
Into which file would it be put on a Macintosh?
Add Thank You Quote this message in a reply
Sep. 01, 2006, 07:49 AM
Post: #23
RE: Suggestion: remove links to ads
There will be two files that go to /Library/Application Support/BFilter/filters

Filename: Meta refresh
Code:
[filter]
search=/<meta\s[^>]*http-equiv\s*=\s*["']?refresh[^>]*>/

replace=<<END
var threshold_sec = 15*60; // 15 min
var str = arguments[0];
var regex = /.*content\s*=\s*["']?(\d+).*/i;
var res = regex.exec(str);
if (res && res[1] >= threshold_sec) {
    return "";
}
return null;
END

replacement_type=js

if_flag=_HTML_

Filename: Meta refresh.enabled
Code:
*
Note that the first file must not have an extension (must not have dots in the name).
Add Thank You Quote this message in a reply
Sep. 03, 2006, 11:14 PM
Post: #24
RE: Suggestion: remove links to ads
jart,
Thanks a bunch! Got them installed. Just out of curiosity, could the .enabled file contain a list of exceptions where I would not want the block to refresh to happen or would that have to be a .disabled file? I cannot think of anywhere where I would not want it to apply now, but you never know.
Add Thank You Quote this message in a reply
Sep. 04, 2006, 11:13 AM
Post: #25
RE: Suggestion: remove links to ads
*.enabled files contain the names of individual filters within a file that are enabled. They are not used for URLs.

You can exclude some URLs like this:
Code:
url = /http://(?!(www\.somehost\.com)|(www\.otherhost\.com)).*/
Add Thank You Quote this message in a reply
Sep. 04, 2006, 08:46 PM
Post: #26
RE: Suggestion: remove links to ads
jart,
I ran into a problem with those filters. I tried applying the new filters for BFilter, and after restarting the computer, Firefox reported that the proxy was refusing connections. After I removed them and rebooted again, Firefox was back to normal again. What could have happened?
Would it make a difference that I used Smultron (a programming text editor) to create the filters?
Add Thank You Quote this message in a reply
Sep. 04, 2006, 09:12 PM
Post: #27
RE: Suggestion: remove links to ads
Probably there is a syntax error in the filter file.
Do this:
Put the filters back in place.
Launch BFilter's installer (BTW, version 1.0.6 was released today).
Proceed with the installation until the point where it fails (it's expected to fail).
Use File -> Show Log, then select Show Everything.
You can post the entire log, or just the error messages following "Starting BFilter".
Add Thank You Quote this message in a reply
Sep. 05, 2006, 07:58 AM
Post: #28
RE: Suggestion: remove links to ads
Quote:Sep 5 00:34:32 MacBook-Pro : @(#)PROGRAM:Install PROJECT:Install-139 DEVELOPER:root BUILT:May 23 2006 08:57:33\n
Sep 5 00:34:32 MacBook-Pro : @(#)PROGRAM:Installer PROJECT:Installer-94 DEVELOPER:root BUILT:Jan 13 2006 18:32:16\n
Sep 5 00:34:32 MacBook-Pro : Hardware: MacBookPro1,2 @ 2160 MHz (x2), 1024 MB
Sep 5 00:34:32 MacBook-Pro : Running OS Build: 8J2135
Sep 5 00:34:32 MacBook-Pro : BFilter 1.0.5 Installation Log
Sep 5 00:34:32 MacBook-Pro : Opened from: /Volumes/BFilter 1.0.5/BFilter.pkg
Sep 5 00:34:33 MacBook-Pro : It took 1.175250 seconds to finish launching.
Sep 5 00:34:35 MacBook-Pro : Distribution: BFilter 1.0.5
Sep 5 00:34:35 MacBook-Pro : Installation checks completed successfully.
Sep 5 00:35:00 MacBook-Pro : admin auth received to install
Sep 5 00:35:00 MacBook-Pro : ================================================================================
Sep 5 00:35:00 MacBook-Pro : User picked Easy Install
Sep 5 00:35:00 MacBook-Pro : Choices selected for installation:
Sep 5 00:35:00 MacBook-Pro : Upgrade: "BFilter 1.0.5"
Sep 5 00:35:00 MacBook-Pro : BFilter.pkg : net.sourceforge.bfilter : 1.0.5.1.0
Sep 5 00:35:00 MacBook-Pro : ================================================================================
Sep 5 00:35:00 MacBook-Pro : It took 0.000978 seconds to summarize the package selections.
Sep 5 00:35:00 MacBook-Pro : Starting installation:
Sep 5 00:35:00 MacBook-Pro : Preparing volume "Macintosh HD" for installation
Sep 5 00:35:00 MacBook-Pro : Configuring volume "Macintosh HD"
Sep 5 00:35:01 MacBook-Pro : Preparing local booted disk
Sep 5 00:35:01 MacBook-Pro : Create temporary directory "/private/tmp/BFilter.pkg.1976NLNaVR"
Sep 5 00:35:01 MacBook-Pro : Processing BFilter 1.0.5:
Sep 5 00:35:01 MacBook-Pro : Initialize patching
Sep 5 00:35:01 MacBook-Pro : Determining files to install
Sep 5 00:35:01 MacBook-Pro : Evaluating versions of bundles
Sep 5 00:35:01 MacBook-Pro : Evaluating custom file version checking
Sep 5 00:35:01 MacBook-Pro : Configuring deferred files
Sep 5 00:35:01 MacBook-Pro : Determing obsolete files
Sep 5 00:35:01 MacBook-Pro : Assembling temporary receipt
Sep 5 00:35:01 MacBook-Pro : Performing pre-extraction actions
Sep 5 00:35:01 MacBook-Pro : ==== It took 0.031402 seconds to check for prebinding
Sep 5 00:35:01 MacBook-Pro : run preupgrade script for BFilter 1.0.5
Sep 5 00:35:01 MacBook-Pro : Removing obsoleted files
Sep 5 00:35:01 MacBook-Pro : Creating destination path
Sep 5 00:35:01 MacBook-Pro : Extracting files
Sep 5 00:35:02 MacBook-Pro : 14 files looked up in 0.00 seconds. 14 files written in 0.40 seconds.
Sep 5 00:35:02 MacBook-Pro : 4260 kilobytes installed.
Sep 5 00:35:02 MacBook-Pro : run postupgrade script for BFilter 1.0.5
Sep 5 00:35:02 MacBook-Pro : Performing post-extraction actions
Sep 5 00:35:02 MacBook-Pro : Assembling receipt
Sep 5 00:35:02 MacBook-Pro : run postflight script for BFilter 1.0.5
Sep 5 00:35:03 MacBook-Pro : postflight[1992]: Stopping BFilter
Sep 5 00:35:03 MacBook-Pro : postflight[1992]:
Sep 5 00:35:03 MacBook-Pro : postflight[1992]: Starting BFilter
Sep 5 00:35:03 MacBook-Pro : postflight[1992]:
Sep 5 00:35:03 MacBook-Pro : postflight[1992]: [Meta refresh:1:233] Unexpected character
Sep 5 00:35:03 MacBook-Pro : postflight[1992]: [Meta refresh:1] 'search' is not specified for filter "filter]^Msearch=/<meta\s[^>]*http-equiv\s*=\s*["']?refresh[^>]*>/^M^Mreplace=<<END^Mvar threshold_sec = 15*60; // 15 min^Mvar str = arguments[0];^Mvar regex = /.*content\s*=\s*["']?(\d+).*/i;^Mvar res = regex.exec(str);^Mif (res && res[1"
Sep 5 00:35:03 MacBook-Pro : postflight[1992]: [Meta refresh:1] 'replace' is not specified for filter "filter]^Msearch=/<meta\s[^>]*http-equiv\s*=\s*["']?refresh[^>]*>/^M^Mreplace=<<END^Mvar threshold_sec = 15*60; // 15 min^Mvar str = arguments[0];^Mvar regex = /.*content\s*=\s*["']?(\d+).*/i;^Mvar res = regex.exec(str);^Mif (res && res[1"
Sep 5 00:35:03 MacBook-Pro : postflight[1992]:
Sep 5 00:35:03 MacBook-Pro : Install failed: The following install step failed: run postflight script for BFilter 1.0.5
Sep 5 00:35:04 MacBook-Pro : Private/Total = (5.1MB, 64.9MB), Heap/Total = (2.5MB, 18.0MB), Regions(malloc, private) = (27, 36)
Sep 5 00:35:04 MacBook-Pro : It took 3.316375 seconds to unsuccessfully install "BFilter 1.0.5" (1 pkg(s))
Sep 5 00:35:04 MacBook-Pro : It took 1.004852 seconds to Configuring volume "Macintosh HD" (dm prepare*disk)
Sep 5 00:35:04 MacBook-Pro : It took 1.381756 seconds to Install BFilter 1.0.5: 26 elements
Sep 5 00:35:04 MacBook-Pro : It took 1.379016 seconds to unsuccessfully Install package BFilter 1.0.5
Sep 5 00:35:04 MacBook-Pro : It took 0.037752 seconds to Build install plan (& redirected paths)
Sep 5 00:35:04 MacBook-Pro : It took 0.111590 seconds to Assembling temporary receipt
Sep 5 00:35:04 MacBook-Pro : It took 0.066274 seconds to Collect path info (ATS, Sec Equiv, Kext, Pref Panes)
Sep 5 00:35:04 MacBook-Pro : It took 0.187956 seconds to run preupgrade script for BFilter 1.0.5
Sep 5 00:35:04 MacBook-Pro : It took 0.513740 seconds to Write files
Sep 5 00:35:04 MacBook-Pro : It took 0.275418 seconds to run postupgrade script for BFilter 1.0.5
Sep 5 00:35:04 MacBook-Pro : It took 0.180729 seconds to Assembling receipt
Sep 5 00:35:04 MacBook-Pro : It took 0.926003 seconds to run postflight script for BFilter 1.0.5
Sep 5 00:35:04 MacBook-Pro : Sep 5 00:35:04 MacBook-Pro : Summary Information
Sep 5 00:35:04 MacBook-Pro : Type Elapsed time (sec)
Sep 5 00:35:04 MacBook-Pro : patch 0.000040
Sep 5 00:35:04 MacBook-Pro : zero 0.003957
Sep 5 00:35:04 MacBook-Pro : script 1.389377
Sep 5 00:35:04 MacBook-Pro : extract 0.513740
Sep 5 00:35:04 MacBook-Pro : config 0.109340
Sep 5 00:35:04 MacBook-Pro : receipt 0.292319
Sep 5 00:35:04 MacBook-Pro : disk 1.004862
Sep 5 00:35:04 MacBook-Pro : install 1.381756
Sep 5 00:35:04 MacBook-Pro :
There it is - the whole log from the installation. It seems to be indicating an incorrect character somewhere.
Add Thank You Quote this message in a reply
Sep. 05, 2006, 08:47 AM
Post: #29
RE: Suggestion: remove links to ads
It looks like the file was saved in the old "Mac OS Classic" way, using \r for newlines. BFilter doesn't support that.
I could not reproduce it with Smultron. For me, it saves in the Unix way, which is the right thing for OSX. Many editors have an option for switching between Mac/Unix/Windows line endings. Try copy-pasting that filter to a different editor.
Add Thank You Quote this message in a reply
Sep. 06, 2006, 05:50 AM
Post: #30
RE: Suggestion: remove links to ads
Yay! That fixed it. Smultron is versatile. I just changed the line endings to Unix. Thanks a whole bunch more.
Add Thank You Quote this message in a reply
Post Reply 


Forum Jump: