mortenn / BrowserPicker

Smart browser selector for Windows
MIT License
242 stars 17 forks source link

After I have added new browser and clicked Done it doesn't show on next launch #109

Closed Mart-Bogdan closed 5 months ago

Mart-Bogdan commented 5 months ago

Version: v2.0.6

After I have added new browser and clicked Done it doesn't show on next launch when I run app from Start menu, and also when I use links with this app. 1. image 2. image 3. image

Nevermind that on this screenshot there is fooo as app name. I've tried with real one. It still didn't work.

mortenn commented 5 months ago

it does get added to the registry, but most the properties are not saved, so it gets filtered out as invalid

Mart-Bogdan commented 5 months ago

I assume that registry subkey called BrowserList should be created.

image

But it is empty. And 3 browsers shown aren't there as well. I assume autodetected browsers aren't cached(saved) in reg?

Mart-Bogdan commented 5 months ago

My bad. I was looking on HKLM not HKCU

Mart-Bogdan commented 5 months ago

I know what's the bug is:
image

image

It's getting name of calling method instead of name of argument. https://github.com/mortenn/BrowserPicker/blob/2518f238f97581dfb9459f27debbacfe84e8ed45/src/BrowserPicker.Windows/AppSettings.cs#L80-L86

Mart-Bogdan commented 5 months ago

Wow you are so fast. thank you :-)

mortenn commented 5 months ago

I just happened to be at my computer and planning on looking at other bugs, you're welcome :)

Mart-Bogdan commented 5 months ago
        /// <summary>Throws an <see cref="ArgumentNullException"/> if <paramref name="argument"/> is null.</summary>
        /// <param name="argument">The reference type argument to validate as non-null.</param>
        /// <param name="paramName">The name of the parameter with which <paramref name="argument"/> corresponds.</param>
        public static void ThrowIfNull([NotNull] object? argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null)

i think attribute CallerArgumentExpression is what you wanted to have

Mart-Bogdan commented 5 months ago

image

But it's still not perfect.

I guess specifying name by hands is mos't relliable

mortenn commented 5 months ago

I just had to specify manually, the method being used wasn't intended to be used like I was.