Make user agent string and default homepage configurable from Makefile.config
svn path=/trunk/netsurf/; revision=4803
This commit is contained in:
parent
806d362674
commit
9eacc5ca04
3
Makefile
3
Makefile
|
@ -212,6 +212,9 @@ $(eval $(call feature_enabled,HARU_PDF,-DWITH_PDF_EXPORT,-lhpdf -lpng,PDF export
|
|||
# common libraries without pkg-config support
|
||||
LDFLAGS += -lz
|
||||
|
||||
CFLAGS += -DNETSURF_UA_FORMAT_STRING=\"$(NETSURF_UA_FORMAT_STRING)\"
|
||||
CFLAGS += -DNETSURF_HOMEPAGE=\"$(NETSURF_HOMEPAGE)\"
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# RISC OS host flag setup
|
||||
# ----------------------------------------------------------------------------
|
||||
|
|
|
@ -37,6 +37,16 @@ endif
|
|||
# Valid options: YES, NO
|
||||
NETSURF_STRIP_BINARY := NO
|
||||
|
||||
# Template used for constructing the User Agent: string. The first two
|
||||
# replacements are major/minor version, second two are OS and architecture.
|
||||
# Please don't be tempted to mention Mozilla here! Let's let that lie die.
|
||||
NETSURF_UA_FORMAT_STRING := "NetSurf/%d.%d (%s; %s)"
|
||||
|
||||
# Default home page if one is not defined. Note that this does not apply to
|
||||
# the RISC OS version, as it has its own local home page, and it can be changed
|
||||
# by editing the end of gui_init2() in riscos/gui.c
|
||||
NETSURF_HOMEPAGE := "http://www.netsurf-browser.org/welcome/"
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# RISC OS-specific options
|
||||
# ----------------------------------------------------------------------------
|
||||
|
|
|
@ -578,7 +578,7 @@ void gui_init(int argc, char** argv)
|
|||
void gui_init2(int argc, char** argv)
|
||||
{
|
||||
CALLED();
|
||||
const char *addr = "http://netsurf-browser.org/welcome/";
|
||||
const char *addr = NETSURF_HOMEPAGE;
|
||||
|
||||
if (option_homepage_url != NULL && option_homepage_url[0] != '\0')
|
||||
addr = option_homepage_url;
|
||||
|
|
|
@ -552,7 +552,7 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
|
|||
break;
|
||||
case 'home':
|
||||
{
|
||||
static const char *addr = "http://netsurf-browser.org/welcome/";
|
||||
static const char *addr = NETSURF_HOMEPAGE;
|
||||
|
||||
if (option_homepage_url != NULL && option_homepage_url[0] != '\0')
|
||||
addr = option_homepage_url;
|
||||
|
|
|
@ -302,7 +302,7 @@ void gui_init(int argc, char** argv)
|
|||
void gui_init2(int argc, char** argv)
|
||||
{
|
||||
struct browser_window *bw;
|
||||
const char *addr = "http://netsurf-browser.org/welcome/";
|
||||
const char *addr = NETSURF_HOMEPAGE;
|
||||
|
||||
if (option_homepage_url != NULL && option_homepage_url[0] != '\0')
|
||||
addr = option_homepage_url;
|
||||
|
|
|
@ -392,7 +392,7 @@ gboolean nsgtk_window_reload_button_clicked(GtkWidget *widget, gpointer data)
|
|||
gboolean nsgtk_window_home_button_clicked(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
struct gtk_scaffolding *g = data;
|
||||
static const char *addr = "http://netsurf-browser.org/welcome/";
|
||||
static const char *addr = NETSURF_HOMEPAGE;
|
||||
struct browser_window *bw = nsgtk_get_browser_for_gui(g->top_level);
|
||||
|
||||
if (option_homepage_url != NULL && option_homepage_url[0] != '\0')
|
||||
|
|
|
@ -27,7 +27,9 @@
|
|||
|
||||
static const char *core_user_agent_string = NULL;
|
||||
|
||||
#ifndef NETSURF_UA_FORMAT_STRING
|
||||
#define NETSURF_UA_FORMAT_STRING "NetSurf/%d.%d (%s; %s)"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Prepare core_user_agent_string with a string suitable for use as a
|
||||
|
@ -75,5 +77,5 @@ user_agent_string(void)
|
|||
{
|
||||
if (core_user_agent_string == NULL)
|
||||
user_agent_build_string();
|
||||
return core_user_agent_string;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue