Opened 6 years ago

Closed 5 years ago

#9965 closed enhancement (fixed)

allow browser proxy config values to be overridden by other js

Reported by: infinity0 Owned by: infinity0
Priority: Low Milestone:
Component: Archived/Flashproxy Version:
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

You could then do e.g.

<script>
/* overrides */
</script>
<script src="flashproxy.public.site/proxy.js"></script>

in your embed.html.

Child Tickets

Change History (5)

comment:1 Changed 6 years ago by dcf

Is this different than the query string parameters accepted by flashproxy.js? Perhaps JavaScript code is a nicer way to do it?

Can you show an example of how this might look? I.e., fill in the /* overrides */ part of the example in the ticket description.

comment:2 Changed 6 years ago by infinity0

aha, I overlooked the query string params. But that only lets the visitor control the params, it doesn't let the site owner set the defaults. (And the latter is more likely to want to do that anyway.)

If we wanted to support that, I think it would be an easy edit - in flashproxy.js, change all the constants to instead do a conditional define, like this:

var DEFAULT_FACILITATOR_URL = DEFAULT_FACILITATOR_URL || "https://fp-facilitator.org/";

Then in the /* overrides */ part, the site owner can set their own value, which flashproxy will then read and honour.

comment:3 in reply to:  2 Changed 6 years ago by dcf

Replying to infinity0:

aha, I overlooked the query string params. But that only lets the visitor control the params, it doesn't let the site owner set the defaults. (And the latter is more likely to want to do that anyway.)

If we wanted to support that, I think it would be an easy edit - in flashproxy.js, change all the constants to instead do a conditional define, like this:

var DEFAULT_FACILITATOR_URL = DEFAULT_FACILITATOR_URL || "https://fp-facilitator.org/";

Then in the /* overrides */ part, the site owner can set their own value, which flashproxy will then read and honour.

Okay, making the variables overridable in this way is fine with me.

In general, it is the site owner, and not the visitor, who sets the query string parameters. They put the parameters in their HTML, and all their visitors use it automatically. A good example is at https://crypto.stanford.edu/flashproxy/#badge-howto, where it shows you how to set the cookierequired parameter for all your web site visitors. You can set facilitator, for example, in the same way.

comment:4 Changed 5 years ago by infinity0

Owner: changed from dcf to infinity0
Status: newassigned

comment:5 Changed 5 years ago by infinity0

Resolution: fixed
Status: assignedclosed

Fixed and pushed to tpo.

Note: See TracTickets for help on using tickets.