putting a canonical tag on http://www.example.com/widgets/ as follows: <link rel="canonical" href="http://www.example.com/widgets/"/>
This should solve the problem of google thinking that /widgets/#top and /widgets/#samples are separate pages but how does it look when google crawls the main page? Did I just create some crazy, never ending loop?
You can point a rel=canonical to the page it's on without any issue.
This should solve the problem of google thinking that /widgets/#top and /widgets/#samples are separate pages...
A note about this part: There isn't a problem with Google thinking a fragment is indicating a different page -- IOW: Unlike stuff after a ?, stuff after the # [as long as you're not using #! which indicates a page-state that changes via AJAX] does not "create a different/duplicate page".