kirby-webpack icon indicating copy to clipboard operation
kirby-webpack copied to clipboard

Update browsersync-update-content.js

Open benwest opened this issue 4 years ago • 5 comments

The method of detecting the panel didn't work for me, maybe Kirby 3.5 broke it? This works.

benwest avatar Feb 11 '21 20:02 benwest

Hello @benwest,

Thanks for your interest in Kirby Webpack. Can you be more specific when you say "method of detecting the panel didn't work"? What didn't work exactly? The panel seems to work correctly on my side when I connect to localhost:8080/panel (with Kirby 3.5.3)

antoine1000 avatar Feb 20 '21 17:02 antoine1000

The panel would reload whenever the .lock file was written, because inPanel() === false.

benwest avatar Feb 22 '21 09:02 benwest

I just did a fresh install of Kirby 3.5.1, went to /panel, pasted inPanel's definition into the console, and called it - false.

benwest avatar Feb 22 '21 14:02 benwest

The panel would reload whenever the .lock file was written, because inPanel() === false.

I got the same issue and your PR fixes it.

The only issue I see with your fix is if someone have a panel key in their global namespace, in which case the inPanel() function will cause a false positive.

arnaudjuracek avatar Feb 22 '21 14:02 arnaudjuracek

True, neither method is ideal, but these are edge cases and I don’t think this way is any worse.

Speculatively what would be the clean/correct way to do this? A Kirby plugin?

benwest avatar Feb 23 '21 20:02 benwest