From 574c1407d0c3253547b552f98952b1665e4f2cb1 Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Mon, 28 Sep 2015 09:35:21 +0100 Subject: Add various changes --- .notes/Notes | 2 -- .uzbl/config | 3 ++- .uzbl/scripts/adblock.js | 28 ++++++++++++++++++++++++++++ .vim/vimrc | 3 ++- 4 files changed, 32 insertions(+), 4 deletions(-) create mode 100755 .uzbl/scripts/adblock.js diff --git a/.notes/Notes b/.notes/Notes index 326c04c..0fc94b0 100644 --- a/.notes/Notes +++ b/.notes/Notes @@ -2,9 +2,7 @@ Notes # Phd Todos • High priority - ◦ Establish structure of draft paper ◦ Investigate proof of spectral convergence - ◦ Register by the health center in London • Medium priority ◦ Investigate proof of weak convergence ◦ Obtain rigourous homogenization result diff --git a/.uzbl/config b/.uzbl/config index fd2cedf..2464ca7 100644 --- a/.uzbl/config +++ b/.uzbl/config @@ -453,5 +453,6 @@ set uri = uzbl.org/doesitwork/@COMMIT @bind o = sh 'uri=`$HOME/dotfiles/.uzbl/scripts/load_url_from_surfraw.sh` && echo "uri $uri" > "$UZBL_FIFO"' @on_event DOWNLOAD_COMPLETE spawn @scripts_dir/downloadviewer.sh %s -@on_event LOAD_COMMIT spawn @scripts_dir/adblock.py +# @on_event LOAD_COMMIT spawn @scripts_dir/adblock.py +# @on_event LOAD_COMMIT script @sdir/adblock.js # vim: set fdm=syntax: diff --git a/.uzbl/scripts/adblock.js b/.uzbl/scripts/adblock.js new file mode 100755 index 0000000..b581f9b --- /dev/null +++ b/.uzbl/scripts/adblock.js @@ -0,0 +1,28 @@ +var blocklist = new Array(); +blocklist["IMG"] = [["src", /.*doubleclick.net.*/], + ["src", /.*last.fm\/adserver.*/]]; + +blocklist["SCRIPT"] = [["src", /.*doubleclick.net.*/]]; + +blocklist["IFRAME"] = [["name", /.*google_ads.*/], + ["id", /.*ad-google.*/]]; + + + + +function adblock(event) +{ + var tag = event.target.tagName; + if (!blocklist[tag]) + return; + for(var i = 0; i < blocklist[tag].length; i++) { + if (event.target.getAttribute(blocklist[tag][i][0])) { + if (event.target.getAttribute(blocklist[tag][i][0]).match(blocklist[tag][i][1])) { + event.preventDefault(); + return; + } + } + } +} + +document.addEventListener("beforeload", adblock, true); diff --git a/.vim/vimrc b/.vim/vimrc index cc7a290..ce69e46 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -45,7 +45,8 @@ Plug 'tpope/vim-surround' Plug 'tpope/vim-unimpaired' Plug 'tpope/vim-vinegar' Plug 'troydm/zoomwintab.vim' -Plug 'Valloric/YouCompleteMe', { 'do' : './install.sh --clang-completer' } +Plug 'Valloric/YouCompleteMe' +", { 'do' : './install.sh --clang-completer' } Plug 'xolox/vim-misc' Plug 'xolox/vim-notes' call plug#end() -- cgit v1.2.3