obsidian-search-on-internet icon indicating copy to clipboard operation
obsidian-search-on-internet copied to clipboard

Add option to get URL of iframe from context menu

Open AngelusDomini opened this issue 4 years ago • 6 comments

Just downloaded this plugin. I believe it is going to help me to do some research on specific topics without having to open my browser (thanks to iframe) which is where I usually get distracted. So thank you.

Now, when setting the option of this plugin to open the search in iframe, there does not seem to be an option to show or copy to clipboard the URL of the webpage that is currently displayed in the pane from the context menu. This wouldn't be a problem with actual browsers that have the address bar, but we don't have this in iframe. It would be great to have the ability to retrieve the URL of the current pane, which would make adding references to our notes easier (or other use cases that involve pasting or opening external links for that matter).

AngelusDomini avatar Jan 31 '21 05:01 AngelusDomini

Hi, this is a great idea. Will add it in the next release!

HEmile avatar Feb 01 '21 09:02 HEmile

I've been looking into this, but unfortunately this isn't possible because of security restrictions on iframes: https://stackoverflow.com/questions/938180/get-current-url-from-iframe . I'd recommend just opening in your browser if you need anything more than a quick lookup on wikipedia or google.

HEmile avatar Feb 04 '21 16:02 HEmile

I see, thanks for the effort and for letting us know 😊

AngelusDomini avatar Feb 05 '21 04:02 AngelusDomini

That's a shame that this isn't possible! Perhaps one compromise could be to atleast copy a link after right clicking it? Or does that pose the same limitation? So instead of getting the URL of the current page, copy the URL of the right-clicked link

SkepticMystic avatar Aug 27 '21 09:08 SkepticMystic

That's a shame that this isn't possible! Perhaps one compromise could be to atleast copy a link after right clicking it? Or does that pose the same limitation? So instead of getting the URL of the current page, copy the URL of the right-clicked link

I can do that, if you think that'd be useful! Although it may be counterintuitive behaviour

HEmile avatar Aug 31 '21 06:08 HEmile

A +1 for @SkepticMystic's suggestion. I see why it might be counterintuitive, but with sufficient documentation, still useful. Thanks! Excellent work!

jebeaudoin avatar Nov 25 '21 15:11 jebeaudoin