Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why about://home and not config.home? #8

Closed
TheBrenny opened this issue Jul 25, 2018 · 1 comment
Closed

Why about://home and not config.home? #8

TheBrenny opened this issue Jul 25, 2018 · 1 comment
Labels

Comments

@TheBrenny
Copy link

So with such a confronting title question, let me start off by saying wicked extensions! You've literally saved my life! #ReferencingDocsWithLightningSpeed! Hats off to you! 🍻

But, back to the point... 😅 I've been flicking through for the last hour trying to figure out how this whole thing works, and after a lazy attempt to trace from the start, I decided to trace from the back and found out that you're loading about://home and then redirecting to the correct page from there. I've gotta ask... why? Why can't we just replace all references to about://home with config.home?

I've got it working without (*well... not quite without...) issues. And perhaps opening this up could be the beginning of right+click and 'Search Google for "potatoes"'?

So long story (3.5hrs worth) short, why not replace about://home with config.home?

@FabianLauer
Copy link
Owner

Glad you like the extension. Keep in mind it's very much experimental 😇
I see a few questions here, let me try to answer them.

Search Google feature

And perhaps opening this up could be the beginning of right+click and 'Search Google for "potatoes"'

Please open a separate issue for this so we can track it as a feature request. Thanks!

Understanding the Codebase

... after a lazy attempt to trace from the start ...

This diagram could help. Quite old, maybe not fully up to date, but it should give you an idea of the codebase.

about://home vs config.home

Like in some other browsers, the only job of the about://home page is to display the user's home page. Actually, about://home is the only part of the codebase that should concern itself with determining what the user's actual home page is. It does it like this:

window.vscodeBrowser.load(config.home);

For this reason, the implementation of about://home is the only part of the code that actually consumes the value of config.home (there's other files in the codebase were config.home is referenced, but only for updating config variables, not reading them).

Consider about://home as a sign of the SRP.

This makes sending users to the home page very simple. For example:

this.browserBar.onHomeButtonPressed.bind(() => {
this.load('about://home');
});

Sidenote: Browse to about://index to see a list of all about:// pages.

Closing this issue now - hope this answers your questions. Feel free to keep discussing here though.

@FabianLauer FabianLauer changed the title What's the point? Why about://home and not config.home? Jul 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants