X
Thinta lapha ukuze uye kuveshini yamakhalekhukhwini kusayithi.
Scheduled maintenance: Monday, March 30, between 3:30pm and 5:30pm UTC. This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn’t solve your issue and you want to ask a question, we have our support community waiting to help you at @firefox on Twitter

Isithangami Sabeseki

Lolu chungechunge lwabekwa kunqolobane. Uyacelwa ubuze umbuzo omusha uma udinga usizo.

How do I execute a client redirect (based on page content) to a html file?

Kuphostiwe

I am trying to help someone who has a Firefox Add-on that prevents access to adult sites. It works fine and when a blocked URL is entered, this is returned:

The http://www.blocked-site.com domain is blocked to protect this computer from malware or pornographic content.

[NOTE the "www.blocked-site.com" above is just an example; in actuality, the domain is shown]

My friend has created a html file on his computer with a stronger admonition and would like for the browser to redirect to, and display, his custom html file instead of what is currently served.

I am pretty sure something would have to examine the incoming page for some text excluding the actual domain because that would change depending on which site access was attempted. Maybe examine the incoming page for "domain is blocked to protect this computer" and, if present, display the html file. I just don't know how to do it.

I would appreciate any help.

I am trying to help someone who has a Firefox Add-on that prevents access to adult sites. It works fine and when a blocked URL is entered, this is returned: The http://www.blocked-site.com domain is blocked to protect this computer from malware or pornographic content. [NOTE the "www.blocked-site.com" above is just an example; in actuality, the domain is shown] My friend has created a html file on his computer with a stronger admonition and would like for the browser to redirect to, and display, his custom html file instead of what is currently served. I am pretty sure something would have to examine the incoming page for some text excluding the actual domain because that would change depending on which site access was attempted. Maybe examine the incoming page for "domain is blocked to protect this computer" and, if present, display the html file. I just don't know how to do it. I would appreciate any help.

Isisombululo esikhethiwe

Thank you very much - it performs exactly as I wanted (in principle). I will have fun tweaking it.

Thanks for introducing me to the monkey user scripts. I installed TamperMonkey and it works fine.

Funda le mpendulo ngokuhambisana nalesi sihloko 0

Eminye Imininingwane Yohlelo

Fakela amapulagi

  • Shockwave Flash 29.0 r0

Isisebenziso

  • I-ejenti Engumsebenzisi: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0

Eminye Imininingwane

jscher2000
  • Top 10 Contributor
8950 izisombululo 73360 izimpendulo
Kuphostiwe

This might be a hard request to fulfill because web content, and even extensions, are not supposed to have access to file:/// URLs on your computer. It might be easier if the message page were on the internet; I think there probably are extensions to redirect from one web address to another. Then it would just be a matter of finding a good place to host the page (maybe a OneDrive folder, Google Drive, Dropbox, etc.?).

This might be a hard request to fulfill because web content, and even extensions, are not supposed to have access to file:/// URLs on your computer. It might be easier if the message page were on the internet; I think there probably are extensions to redirect from one web address to another. Then it would just be a matter of finding a good place to host the page (maybe a OneDrive folder, Google Drive, Dropbox, etc.?).

Umnikazi wombuzo

I guess I did not describe it clearly. The message displayed IS on a web page. The URL is

http://haydentech.com/private/dns/dns.php?report=www.blocked-site.com

The message shown in the original post is displayed on the page for which I just provided the URL. I really messed up the question, I'm afraid.

Thanks for your response, though, it helped me clarify the issue.

I guess I did not describe it clearly. The message displayed IS on a web page. The URL is http://haydentech.com/private/dns/dns.php?report=www.blocked-site.com The message shown in the original post is displayed on the page for which I just provided the URL. I really messed up the question, I'm afraid. Thanks for your response, though, it helped me clarify the issue.

Umnikazi wombuzo

I know that within Firefox we can open a file:/// URL and that is precisely what we want when such a message as above is shown. I hope that makes sense.

I know that within Firefox we can open a file:/// URL and that is precisely what we want when such a message as above is shown. I hope that makes sense.
jscher2000
  • Top 10 Contributor
8950 izisombululo 73360 izimpendulo
Kuphostiwe

Impendulo Ewusizo

dasadler said

I know that within Firefox we can open a file:/// URL and that is precisely what we want when such a message as above is shown.

Yes, a human user can direct Firefox to do that, but websites and add-ons are not trusted to go to random parts of the hard drive...

It sounds as though the URL is very consistent and you could use an add-on to modify the page contents directly. For example, a "user script" applied using an extension like Tampermonkey, Violentmonkey or Greasemonkey could change the text from

The www.blocked-site.com domain is blocked to protect this computer from malware or pornographic content.

to something like

Just saved you from ruining your career at www.blocked-site.com. You're welcome.

The script also could modify the colors, font sizes, inject images, etc.

If that's of interest.

''dasadler [[#answer-1103487|said]]'' <blockquote> I know that within Firefox we can open a file:/// URL and that is precisely what we want when such a message as above is shown. </blockquote> Yes, a human user can direct Firefox to do that, but websites and add-ons are not trusted to go to random parts of the hard drive... It sounds as though the URL is very consistent and you could use an add-on to modify the page contents directly. For example, a "user script" applied using an extension like Tampermonkey, Violentmonkey or Greasemonkey could change the text from The www.blocked-site''.''com domain is blocked to protect this computer from malware or pornographic content. to something like Just saved you from ruining your career at www.blocked-site''.''com. You're welcome. The script also could modify the colors, font sizes, inject images, etc. If that's of interest.

Umnikazi wombuzo

But a script could not open a file:/// stored on the user's computer?

I thought scripts could basically act as a proxy for the user as defined by the code.

But a script could not open a file:/// stored on the user's computer? I thought scripts could basically act as a proxy for the user as defined by the code.

Umnikazi wombuzo

jscher2000 said

It sounds as though the URL is very consistent and you could use an add-on to modify the page contents directly. For example, a "user script" applied using an extension like Tampermonkey, Violentmonkey or Greasemonkey could change the text from The www.blocked-site.com domain is blocked to protect this computer from malware or pornographic content. to something like Just saved you from ruining your career at www.blocked-site.com. You're welcome. The script also could modify the colors, font sizes, inject images, etc.

If I understand your reply... you're saying that a script could effectively create a web page dynamically? If that is the case, then I suppose it could create the same as the html file he wants displayed. Maybe even better because it could incorporate the name of the blocked site.

But where or how would someone (a very non technical someone) even begin to develop such code?

''jscher2000 [[#answer-1103492|said]]'' <blockquote> It sounds as though the URL is very consistent and you could use an add-on to modify the page contents directly. For example, a "user script" applied using an extension like Tampermonkey, Violentmonkey or Greasemonkey could change the text from The www.blocked-site''.''com domain is blocked to protect this computer from malware or pornographic content. to something like Just saved you from ruining your career at www.blocked-site''.''com. You're welcome. The script also could modify the colors, font sizes, inject images, etc. </blockquote> If I understand your reply... you're saying that a script could effectively create a web page dynamically? If that is the case, then I suppose it could create the same as the html file he wants displayed. Maybe even better because it could incorporate the name of the blocked site. But where or how would someone (a very non technical someone) even begin to develop such code?

Okulungisiwe ngu dasadler

nostromov 1 izisombululo 18 izimpendulo
Kuphostiwe

dasadler said

a Firefox Add-on that prevents access

Ugh., wouldn't you be better off with system-wide parental permissions?.. A (local) proxy, VPN and /or a (router) firewall made for this and similar? :-o

''dasadler [[#question-1214674|said]]'' <blockquote> a Firefox Add-on that prevents access </blockquote> Ugh., wouldn't you be better off with system-wide parental permissions?.. A (local) proxy, VPN and /or a (router) firewall made for this and similar? :-o

Okulungisiwe ngu nostromov

Umnikazi wombuzo

That would involve some subscription fee. Thanks anyway, I appreciate your thoughts.

That would involve some subscription fee. Thanks anyway, I appreciate your thoughts.
jscher2000
  • Top 10 Contributor
8950 izisombululo 73360 izimpendulo
Kuphostiwe

Impendulo Ewusizo

dasadler said

kgb said
Ugh., wouldn't you be better off with system-wide parental permissions?

That would involve some subscription fee.

I think some are free: http://www1.k9webprotection.com/

dasadler said

If I understand your reply... you're saying that a script could effectively create a web page dynamically? If that is the case, then I suppose it could create the same as the html file he wants displayed. Maybe even better because it could incorporate the name of the blocked site. But where or how would someone (a very non technical someone) even begin to develop such code?

This sounds like a call for volunteers. ;-)

I can create a template for the script. The tedious part is filling in the desired HTML because it needs to be properly quoted in order to inserted by the script.

''dasadler [[#answer-1103543|said]]'' <blockquote> ''kgb [[#answer-1103519|said]]'' <blockquote> Ugh., wouldn't you be better off with system-wide parental permissions? </blockquote> That would involve some subscription fee. </blockquote> I think some are free: http://www1.k9webprotection.com/ ''dasadler [[#answer-1103502|said]]'' <blockquote> If I understand your reply... you're saying that a script could effectively create a web page dynamically? If that is the case, then I suppose it could create the same as the html file he wants displayed. Maybe even better because it could incorporate the name of the blocked site. But where or how would someone (a very non technical someone) even begin to develop such code? </blockquote> This sounds like a call for volunteers. ;-) I can create a template for the script. The tedious part is filling in the desired HTML because it needs to be properly quoted in order to inserted by the script.

Umnikazi wombuzo

Thank you.

I think that given a template, I might (??) be able to do the HTML. The html page that has already been created is fairly simplistic. Basically changing the background color to red, an image centered at top, and a couple of lines of white text with different point size.

I would need some guidance on how/where to actually use this script. I don't know if it would go in the userChrome.css or if I would need to use one of the monkey add-ons (and how to actually use it).

Thank you. I think that given a template, I might (??) be able to do the HTML. The html page that has already been created is fairly simplistic. Basically changing the background color to red, an image centered at top, and a couple of lines of white text with different point size. I would need some guidance on how/where to actually use this script. I don't know if it would go in the userChrome.css or if I would need to use one of the monkey add-ons (and how to actually use it).

Umnikazi wombuzo

jscher2000 said

I can create a template for the script. The tedious part is filling in the desired HTML because it needs to be properly quoted in order to inserted by the script.

Did I miss it or was the template for the script not done? If there will not be a template created, please advise so I can seek a solution elsewhere.

Thanks.

''jscher2000 [[#answer-1103598|said]]'' <blockquote> I can create a template for the script. The tedious part is filling in the desired HTML because it needs to be properly quoted in order to inserted by the script. </blockquote> Did I miss it or was the template for the script not done? If there will not be a template created, please advise so I can seek a solution elsewhere. Thanks.
jscher2000
  • Top 10 Contributor
8950 izisombululo 73360 izimpendulo
Kuphostiwe

I don't know what happened to my draft script from last month, but I created a new one and posted it here:

https://greasyfork.org/en/scripts/367925-customize-hayden-technologies-dns-block-page

You would apply that using Violentmonkey / Tampermonkey / Greasemonkey. I only tested in Violentmonkey. Screenshot of the current HTML/CSS/image attached.

I don't know what happened to my draft script from last month, but I created a new one and posted it here: https://greasyfork.org/en/scripts/367925-customize-hayden-technologies-dns-block-page You would apply that using Violentmonkey / Tampermonkey / Greasemonkey. I only tested in Violentmonkey. Screenshot of the current HTML/CSS/image attached.

Isisombululo Esikhethiwe

Thank you very much - it performs exactly as I wanted (in principle). I will have fun tweaking it.

Thanks for introducing me to the monkey user scripts. I installed TamperMonkey and it works fine.

Thank you very much - it performs exactly as I wanted (in principle). I will have fun tweaking it. Thanks for introducing me to the monkey user scripts. I installed TamperMonkey and it works fine.
nostromov 1 izisombululo 18 izimpendulo
Kuphostiwe

jscher2000 said

I think some are free: http://www1.k9webprotection.com/

Yes, ofc. There would have to be free services... For example, something like,

@https://www.google.com/search?q=free+adult+parental+windows+localhost+vpn

Then, there's the OpenDNS Family Shield, https://www.opendns.com/home-internet-security/

... And so on,

@https://www.google.com/search?q=free+parental+controls+dns+proxy

''jscher2000 [[#answer-1103598|said]]'' <blockquote> I think some are free: http://www1.k9webprotection.com/ </blockquote> Yes, ofc. There would ''have to be'' free services... For example, something like, @https://www.google.com/search?q=free+adult+parental+windows+localhost+vpn Then, there's the OpenDNS Family Shield, https://www.opendns.com/home-internet-security/ ... And so on, @https://www.google.com/search?q=free+parental+controls+dns+proxy