summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2014-02-24 00:41:16 +0100
committerportix <portix@gmx.net>2014-02-24 00:41:16 +0100
commitb340d2b57d9534aa734d13368bffa0f16619455c (patch)
tree1be019e4b2711bdb6f8b933634c2a716223bb01b
parentc6d277db4a5178bb0bd912c2b062b54e2639d190 (diff)
parent9716ad3047cb355fac859702d95b1854c90b4960 (diff)
downloaddwb-b340d2b57d9534aa734d13368bffa0f16619455c.zip
Merge branch 'master' of bitbucket.org:portix/dwb
-rw-r--r--examples/extensions/sample (renamed from doc/examples/extension)1
-rw-r--r--examples/js/quvihints.js14
-rw-r--r--src/dwb.c6
-rw-r--r--src/view.c1
-rwxr-xr-xtools/grab_adblocker193
5 files changed, 18 insertions, 197 deletions
diff --git a/doc/examples/extension b/examples/extensions/sample
index 67e7ec5a..ba264607 100644
--- a/doc/examples/extension
+++ b/examples/extensions/sample
@@ -125,5 +125,4 @@ var myExtension = {
return myExtension;
-
// vim:set ft=javascript:
diff --git a/examples/js/quvihints.js b/examples/js/quvihints.js
new file mode 100644
index 00000000..68fd91dc
--- /dev/null
+++ b/examples/js/quvihints.js
@@ -0,0 +1,14 @@
+//!javascript
+// Creates hints for video sites supported by quvi.
+
+var videoplayer = "mplayer";
+
+hint(";v", function(wv, resource) {
+ if (resource[0] !== "@")
+ {
+ system.spawn("quvi dump -s best --exec '" + videoplayer + " %u' " + resource);
+ return true;
+ }
+});
+
+
diff --git a/src/dwb.c b/src/dwb.c
index 90cd2ada..95cab78b 100644
--- a/src/dwb.c
+++ b/src/dwb.c
@@ -772,7 +772,7 @@ dwb_set_normal_message(GList *gl, gboolean hide, const char *text, ...)
vsnprintf(message, sizeof(message), text, arg_list);
va_end(arg_list);
- if (gtk_widget_get_visible(dwb.gui.bottombox))
+ if (dwb.state.mode & COMMAND_MODE || gtk_widget_get_visible(dwb.gui.bottombox))
{
dwb_set_status_bar_text(dwb.gui.lstatus, message, &dwb.color.active_fg, dwb.font.fd_active, false);
}
@@ -938,7 +938,7 @@ dwb_update_status_text(GList *gl, GtkAdjustment *a)
dwb_update_uri(gl, false);
GString *string = g_string_new(NULL);
- const char *bof = back && forward ? " [+-]" : back ? " [+]" : forward ? " [-]" : " ";
+ const char *bof = back && forward ? " [-+]" : back ? " [-]" : forward ? " [+]" : " ";
g_string_append(string, bof);
g_string_append_printf(string, "[%d/%d]", g_list_position(dwb.state.views, dwb.state.fview) + 1, g_list_length(dwb.state.views));
@@ -3287,9 +3287,9 @@ dwb_insert_mode(void)
static DwbStatus
dwb_command_mode(void)
{
+ dwb.state.mode = COMMAND_MODE;
dwb_set_normal_message(dwb.state.fview, false, ":");
entry_focus();
- dwb.state.mode = COMMAND_MODE;
return STATUS_OK;
}/*}}}*/
diff --git a/src/view.c b/src/view.c
index 6e3c98e5..421ce1ba 100644
--- a/src/view.c
+++ b/src/view.c
@@ -1791,6 +1791,7 @@ view_clean(GList *gl)
plugins_free(v->plugins);
g_slist_free(v->status->allowed_plugins);
+ g_slist_free_full(v->status->frames, (GDestroyNotify)util_free_weak_ref);
scripts_remove_tab(v->script_wv);
diff --git a/tools/grab_adblocker b/tools/grab_adblocker
deleted file mode 100755
index 4f750e0a..00000000
--- a/tools/grab_adblocker
+++ /dev/null
@@ -1,193 +0,0 @@
-#!/bin/bash
-
-# Filterlist, uncomment to download lists, mutliple lists are supported, but
-# don't choose too many lists since it will slow down the adblocker
-URLS=(
-
-# Easylist
-# Easylist English
-#https://easylist-downloads.adblockplus.org/easylist.txt
-
-# Easylist Privacy, blocks tracking
-#https://easylist-downloads.adblockplus.org/easyprivacy.txt
-
-# Easylist Without element hiding
-#https://easylist-downloads.adblockplus.org/easylist_noelemhide.txt
-
-# Easylist additional subscriptions
-# Easylist Germany
-#https://easylist-downloads.adblockplus.org/easylistgermany.txt
-
-# Easylist Italy
-#https://easylist-downloads.adblockplus.org/easylistitaly.txt
-
-# Easylist Dutch
-#http://dutchadblockfilters.googlecode.com/svn/trunk/AdBlock_Dutch_hide.txt
-
-# Easylist French
-#http://lian.info.tm/liste_fr.txt
-
-# Easylist China
-#http://adblock-chinalist.googlecode.com/svn/trunk/adblock.txt
-
-# Easylist Bulgaria
-#http://stanev.org/abp/adblock_bg.txt
-
-# Easylist Indonesia
-#http://indonesianadblockrules.googlecode.com/hg/subscriptions/abpindo.txt
-
-# Easylist Finland
-#http://www.wiltteri.net/wiltteri.txt
-
-# Easylist Greece
-#http://www.void.gr/kargig/void-gr-filters.txt
-
-# Adversity
-# Adversity English list
-#https://adversity.googlecode.com/hg/Adversity.txt
-
-# Adversity Privacy
-#https://adversity.googlecode.com/hg/Adversity-Tracking.txt
-
-# Fanboy
-# Fanboy English list
-#http://www.fanboy.co.nz/adblock/fanboy-adblock.txt
-
-# Fanboy Tracking list
-#http://www.fanboy.co.nz/adblock/fanboy-tracking.txt
-
-# Antisocial
-#https://adversity.googlecode.com/hg/Antisocial.txt
-)
-
-
-DESCRIPTION_INTERACTIVE=(
-"Easylist English"
-"Easylist privacy, blocks tracking"
-"Easylist without element hiding"
-"Easylist Germany"
-"Easylist Italy"
-"Easylist Dutch"
-"Easylist French"
-"Easylist China"
-"Easylist Bulgaria"
-"Easylist Indonesia"
-"Easylist Finland"
-"Easylist Greece"
-"Adversity English list"
-"Adversity Privacy"
-"Fanboy English list"
-"Fanboy Tracking list"
-)
-URLS_INTERACTIVE=(
-https://easylist-downloads.adblockplus.org/easylist.txt
-https://easylist-downloads.adblockplus.org/easyprivacy.txt
-https://easylist-downloads.adblockplus.org/easylist_noelemhide.txt
-https://easylist-downloads.adblockplus.org/easylistgermany.txt
-https://easylist-downloads.adblockplus.org/easylistitaly.txt
-http://dutchadblockfilters.googlecode.com/svn/trunk/AdBlock_Dutch_hide.txt
-http://lian.info.tm/liste_fr.txt
-http://adblock-chinalist.googlecode.com/svn/trunk/adblock.txt
-http://stanev.org/abp/adblock_bg.txt
-http://indonesianadblockrules.googlecode.com/hg/subscriptions/abpindo.txt
-http://www.wiltteri.net/wiltteri.txt
-http://www.void.gr/kargig/void-gr-filters.txt
-https://adversity.googlecode.com/hg/Adversity.txt
-https://adversity.googlecode.com/hg/Adversity-Tracking.txt
-http://www.fanboy.co.nz/adblock/fanboy-adblock.txt
-http://www.fanboy.co.nz/adblock/fanboy-tracking.txt
-)
-
-# General not supported filterlists
-_USP="object-subrequest|ping|xbl|xmlhttprequest|dtd|elemhide|other|collapse|donottrack|popup"
-# Only remove rules, not exceptions
-UNSUPPORTED="(^@@.*[\$,]~(${_USP})($|,))"
-UNSUPPORTED+="|(^[^@].*[\$,](${_USP})($|,))"
-
-
-declare PROFILE
-# Parse settings
-CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}"
-CONFIG="${CONFIG_DIR}/dwb/settings"
-
-while read; do
- if [[ ${REPLY} =~ ^\[ ]]; then
- PROFILE=${REPLY:1:$((${#REPLY}-2))}
- fi
- if [ "${PROFILE}" = "default" ] && [[ ${REPLY} =~ ^adblocker-filterlist ]]; then
- DEST=${REPLY//*=/}
- break
- fi
-done < ${CONFIG}
-
-if [ ! ${DEST} ]; then
- if ! test -z $(pgrep -U $(id -u) dwb); then
- cat << !
-You haven't set 'adblocker-filterlist' in dwb yet. You can either set the path
-in dwb or close all instances of dwb and run this script again.
-!
- exit 1
- fi
- DEST=${CONFIG_DIR}/dwb/adblock_default
- echo "No setting 'adblocker-filterlist' found for profile default, using '${DEST}'"
- sed -i "0,/adblocker-filterlist/s#^adblocker-filterlist=.*#adblocker-filterlist=${DEST}#" ${CONFIG}
-fi
-
-echo -e "The filterlist will be saved as ${DEST}\n"
-
-if [ -e ${DEST} ]; then
- rm ${DEST}
-fi
-
-AFTER=0
-BEFORE=0
-REMOVED=0
-TOTAL=0
-
-get_list() {
- local TMP=$(mktemp)
- echo "Grabbing ${1}"
- wget -O ${TMP} ${1} &>/dev/null
- BEFORE=( $(wc -l "${TMP}") )
-
- ((BEFORE+=TOTAL))
- sed -r "/${UNSUPPORTED}/d" "${TMP}" >> ${DEST}
- rm ${TMP}
- AFTER=( $(wc -l "${DEST}") )
- ((REMOVED=BEFORE-AFTER))
- TOTAL=${BEFORE}
-}
-
-# Download the filterlists
-if [ $# -gt 0 ]; then
- URLS=$@
-fi
-if [ ${#URLS[@]} -gt 0 ]; then
- for URL in ${URLS[@]}; do
- get_list ${URL}
- done
-else
- OLDPS3=$PS3
- echo -e "Choose filterlists:\n"
- PS3="Comma-separated list: "
- select blub in "${DESCRIPTION_INTERACTIVE[@]}"; do
- echo
- REPURL=( ${REPLY//,/ } )
- for n in ${REPURL[@]}; do
- if [ ! ${URLS_INTERACTIVE[$((n-1))]} ]; then
- echo "Choose appropriate numbers next time."
- exit 1
- fi
- done
- for n in ${REPURL[@]}; do
- get_list ${URLS_INTERACTIVE[$((n-1))]}
- done
- break
- done
- PS3=${OLDPS3}
-fi
-
-echo "Removed ${REMOVED} unsupported of ${BEFORE} filters."
-echo "Removing comments."
-sed -i "/^[!\[]/d" "${DEST}"
-echo "Done."