I'm trying to use NavigationMixin.GenerateUrl from an LWC to open a link to an external url e.g. https://google.com
The issue i am seeing is Salesforce opens a new window and appends my URL to the org e.g https://computing-inspiration-XXXX.scratch.lightning.force.com/lightning/webpage/https%3A%2F%2Fgoogle.com
Below is an extract from my LWC:
urlString = 'https://google.com';
this[NavigationMixin.GenerateUrl]({
type: 'standard__webPage',
attributes: {
url: urlString.toString()
}
}).then((url) => {
window.open(url,'_blank');
});
Can anyone provide any guidance here? from the documentation / examples i have seen this should work.