Hacking COMPLETED SwitchBru DNS Update v4.0.0 Public Beta

softwareengineer

Well-Known Member
Newcomer
Joined
Apr 17, 2018
Messages
75
Trophies
0
Age
39
XP
217
Country
United States
One question, is there a way to put a button that returns you to the home page of the menu while you use the browser? It's silly but when you have been using the internet for a while and want to go back to the Google search engine or want to go to one of your saved links on the SwitchBru page, you have to either press B several times back or remove and set the browser again, losing time.

Your post got me to test my idea I've had as a way to do that to see if it would work... Well it works, except a lot of sites restrict you from being able to use it (a security worry). So it's ultimately not as useful as it could be. Yes it's true we can't control the browser directly just through dns, but we can make it load a page with a home button and url field header, and an iframe embedding your browsing page within it. So that as you navigate, the header with the url field and home button stays at the top but the iframe changes pages. The idea being to always be able to quickly go back home, or to any url.

Here's an example of what I mean (and my new default 'captive portal' page):
Code:
<html>
<head><title>YourFrendlyDNS Starting Place!</title>
<style>
body {
margin: 0;
padding: 0;
border: 0;
overflow: hidden;
height: 100%;
max-height: 100%;
}

#urlfield_header {
background: white;
position: fixed;
top: 0px;
left: 0;
right: 0;
bottom: 0px;
width: 100%;
overflow: hidden;
}

#navi {
position: fixed;
top: 23px;
left: 0;
right: 0;
bottom: 0px;
overflow: hidden;
}
</style>

<script>
function keysDown(event)
{
    if(event.keyCode == 13)
        go();
}

function go()
{
     var url = document.getElementById("urlfield").value;
     if(!url.includes("http://") && !url.includes("https://"))
         url = "http://" + url;
     document.getElementById("pagecontent").src = url;
}
</script>
<body>

<div id="urlfield_header">
<input type="button" id="home" value="Home" onclick="document.getElementById('urlfield').value ='startpage.com'; go()"/>
<input type="text" id="urlfield" onkeydown="keysDown(event)" style="width: 50%"/>
<input type="button" id="navigate" value="Go!" onclick="go()"/>
</div>

<div id="navi">
<iframe id="pagecontent" src="https://startpage.com" width="100%" height="100%" frameborder="0"/>
</div>

</body>
</html>

bti1OLx.png

Pictured: I attempted to load an NXDOMAIN / non existent domain (same effect as a blocked one) and was then redirected to the server's captive portal. (the attached small html page) I then tried to navigate to gbatemp.net from the makeshift url field, and as you can see from the image "Load denied by X-Frame-Options-> 'does not permit cross-origin framing' ". Then I hit the home button and it loaded back to startpage... (So startpage of course doesn't have this setting set).

In theory if you do mostly go to places that don't block cross origin framing, then this method would be acceptable to you. Well maybe the switches browser doesn't care about the X-Frame-Options header though, but seems unlikely. Well it was worth a shot! And it does work except for the X-Frame-Options problem. So it's either take some more extreme measures(for a very un-extreme thing like web browsing?) or we should just homebrew it which will either let us control the browser normally or a homebrew fully featured browser! I'd say that's our best bet, in the meantime make the best of what we have!
 

Ep8Script

Well-Known Member
OP
Member
Joined
Aug 5, 2017
Messages
335
Trophies
0
XP
555
Country
Australia
Your post got me to test my idea I've had as a way to do that to see if it would work... Well it works, except a lot of sites restrict you from being able to use it (a security worry). So it's ultimately not as useful as it could be. Yes it's true we can't control the browser directly just through dns, but we can make it load a page with a home button and url field header, and an iframe embedding your browsing page within it. So that as you navigate, the header with the url field and home button stays at the top but the iframe changes pages. The idea being to always be able to quickly go back home, or to any url.

Here's an example of what I mean (and my new default 'captive portal' page):
Code:
<html>
<head><title>YourFrendlyDNS Starting Place!</title>
<style>
body {
margin: 0;
padding: 0;
border: 0;
overflow: hidden;
height: 100%;
max-height: 100%;
}

#urlfield_header {
background: white;
position: fixed;
top: 0px;
left: 0;
right: 0;
bottom: 0px;
width: 100%;
overflow: hidden;
}

#navi {
position: fixed;
top: 23px;
left: 0;
right: 0;
bottom: 0px;
overflow: hidden;
}
</style>

<script>
function keysDown(event)
{
    if(event.keyCode == 13)
        go();
}

function go()
{
     var url = document.getElementById("urlfield").value;
     if(!url.includes("http://") && !url.includes("https://"))
         url = "http://" + url;
     document.getElementById("pagecontent").src = url;
}
</script>
<body>

<div id="urlfield_header">
<input type="button" id="home" value="Home" onclick="document.getElementById('urlfield').value ='startpage.com'; go()"/>
<input type="text" id="urlfield" onkeydown="keysDown(event)" style="width: 50%"/>
<input type="button" id="navigate" value="Go!" onclick="go()"/>
</div>

<div id="navi">
<iframe id="pagecontent" src="https://startpage.com" width="100%" height="100%" frameborder="0"/>
</div>

</body>
</html>

bti1OLx.png

Pictured: I attempted to load an NXDOMAIN / non existent domain (same effect as a blocked one) and was then redirected to the server's captive portal. (the attached small html page) I then tried to navigate to gbatemp.net from the makeshift url field, and as you can see from the image "Load denied by X-Frame-Options-> 'does not permit cross-origin framing' ". Then I hit the home button and it loaded back to startpage... (So startpage of course doesn't have this setting set).

In theory if you do mostly go to places that don't block cross origin framing, then this method would be acceptable to you. Well maybe the switches browser doesn't care about the X-Frame-Options header though, but seems unlikely. Well it was worth a shot! And it does work except for the X-Frame-Options problem. So it's either take some more extreme measures(for a very un-extreme thing like web browsing?) or we should just homebrew it which will either let us control the browser normally or a homebrew fully featured browser! I'd say that's our best bet, in the meantime make the best of what we have!
Another website was already set up with iframes, but yeah of course it follows cross origin rules - iframes just don't work for it at all.

YES! A chatroom!!! That's all I needed.
Good to hear! There's group chats coming in a future update. :)
 

Ep8Script

Well-Known Member
OP
Member
Joined
Aug 5, 2017
Messages
335
Trophies
0
XP
555
Country
Australia
Looks like friend requests are broken it seems
I don't think they are broken, I still got one other today... unless that was you (well, I don't actually remember but still) and I forgot, what's your name on there?

Maybe try adding me again
 

Ep8Script

Well-Known Member
OP
Member
Joined
Aug 5, 2017
Messages
335
Trophies
0
XP
555
Country
Australia
Think it could be related to the issue we had with it yesterday where I appeared as "offline", but wasn't?
Nah not really, I think that was because you came back from another page and it didn't check for notifications again. Not too sure how to fix that.
 
  • Like
Reactions: Taffy

PatrickJr

Well-Known Member
Member
Joined
Jan 5, 2017
Messages
270
Trophies
0
Age
33
Location
Bridgwater
Website
grimtech.co.uk
XP
752
Country
I don't think they are broken, I still got one other today... unless that was you (well, I don't actually remember but still) and I forgot, what's your name on there?

Maybe try adding me again

It's the same as it is on here, PatrickJr.

Says

You have already sent this user a friend request.
 
Last edited by PatrickJr,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Psionic Roshambo @ Psionic Roshambo:
    I think I have a 256GB card in my 3DS lol
  • Psionic Roshambo @ Psionic Roshambo:
    It's a New 3DS XL so it's still under warranty... If it ever breaks gonna make Nintendo fix it lol You said it was new.... For eternity!!!
  • Psionic Roshambo @ Psionic Roshambo:
    But my 3DS is loaded with emulators and 3DS games and DS games and GBA games probably thousands of games in total lol
  • Xdqwerty @ Xdqwerty:
    Brb going with my dad
  • Xdqwerty @ Xdqwerty:
    @Psionic Roshambo, are most of those games shovelware?
    +1
  • K3Nv2 @ K3Nv2:
    Nah gotta buy 3 1tb SD cards for 3ds the entire libraries need archived in my home
    +1
  • SylverReZ @ SylverReZ:
    >buys x3 1TB SD cards
    >stores the entire 3DS library on them
    >installs CFW
    >realised why I wasted loads of money and resources
    +2
  • Psionic Roshambo @ Psionic Roshambo:
    Lol no I clean my sets
  • K3Nv2 @ K3Nv2:
    Cause it's in my home ready to go
  • K3Nv2 @ K3Nv2:
    Like uremum
  • Psionic Roshambo @ Psionic Roshambo:
    But 100 games on SNES and Genesis and GBA then TG16 and NES and GB and GBC then all the other random systems and arcade games it all adds up lol
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Virtual Boy alone has probably 5 games!!! Lol
    +1
  • K3Nv2 @ K3Nv2:
    I won't mention any names in chat but some of us wastes $300 on preloaded hdds :tpi:
    +1
  • SylverReZ @ SylverReZ:
    @Psionic Roshambo, The PS5 had none.
    +2
  • Psionic Roshambo @ Psionic Roshambo:
    Lol I spent more than that on a stuffed 4TB drive lol
  • K3Nv2 @ K3Nv2:
    Honestly I've yet to fill the 1tb internal drive on my ps5
    +1
  • Xdqwerty @ Xdqwerty:
    @SylverReZ, 1) except final fantasy 16. 2) why would I have a console's whole catalogue if most of the games are either shovelware or terrible games?
  • Psionic Roshambo @ Psionic Roshambo:
    Kind of a waste, but the allure of all those games over 100,000
  • Psionic Roshambo @ Psionic Roshambo:
    Some shovel ware with low ratings you might enjoy more than the ratings would sugest
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Cruisn on the Wii is one of my personal examples of that, it's considered one of the worst games of all time, I loved it and completed it several times.
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    The trick for me was to go into the settings and crank up the Wiimote sensitivity to the max and it gets twitchy but you can win that way lol
  • Psionic Roshambo @ Psionic Roshambo:
    Lots of other games I enjoyed that reviews would say otherwise lol
  • btei @ btei:
    lethal company servers are down rn
  • btei @ btei:
    my pocket pikachu is going crazy rn
  • Psionic Roshambo @ Psionic Roshambo:
    Pocket Pikachu sounds dirty lol
    Psionic Roshambo @ Psionic Roshambo: Pocket Pikachu sounds dirty lol