Distribute cognition. Write down the URL's you're surfing, and put them on your @computer list. Then you get to look at those actions against your other ones and objectively decide what you should be doing off of that list. I guarantee you that when you look at "Check eBay" against your other @computer actions, you'll make a better choice.
The problem isn't that web surfing is frivolous. The problem is that you're leaving frivolous activities in psychic RAM, so the only way to offload them is to do them as soon as they occur to you instead of deferring them with appropriate reminders.
First, you will have to find the method that works for you. There is no universal method.
I have found that monitoring my behavior, or keeping a log of it, is often sufficient to get me to modify that behavior.
So, it might be sufficient for you merely to keep a log.
If that is not sufficient. Set a goal. Is your goal to eliminate frivolous internet or is it to spend less than an hour a day, etc.?
You could then keep score. Each day give yourself x points if you surf 0-60 minutes. Give youself -y points for each minute over 60.
If that does not work you could vow that every day you spend more than 60 minutes surfing you will send $Z00.00 to the American Nazi Party (presuming that you find their views vile and repulsive) or that you will burn $100 for every 10 minutes (or fraction thereof) over 60 minutes. You get the idea.
If that does not work you could find a confederate and tell them you need their help. Give them the money and tell them to mail the check if you exceed your limit.
Extinguishing bad habits and developing good habits is essential to be adept at GTD. All of us have our demons and our struggles. Relying on willpower alone is rarely effective. Using the behavioral methods I have outlined above is one (not the only) way to instill habits to achieve one's goals.