jsPanel4 icon indicating copy to clipboard operation
jsPanel4 copied to clipboard

Load external URL into Panel without iframe ?

Open MadTomT opened this issue 2 years ago • 6 comments

Is it possible to load an external URL into a panel without using content iFrame ? and keep all links opened within the page within the same panel ?

Thanks

MadTomT avatar May 23 '23 10:05 MadTomT

Using contentAjax I can load my site into a panel, but clicking on a link then loads that link out of the panel. Is there anyway to get the links from within one panel to open within that panel ?

MadTomT avatar May 23 '23 12:05 MadTomT

On my opinion ,

The link must call javascript which will close the

Current Jspanel

And open new Jspanel with new contacts.

Avi hafner

Sent from my Galaxy

-------- Original message -------- From: MadTomT @.> Date: 5/23/23 21:57 (GMT+09:00) To: Flyer53/jsPanel4 @.> Cc: Subscribed @.***> Subject: Re: [Flyer53/jsPanel4] Load external URL into Panel without iframe ? (Issue #204)

Using contentAjax I can load my site into a panel, but clicking on a link then loads that link out of the panel. Is there anyway to get the links from within one panel to open within that panel ?

— Reply to this email directly, view it on GitHubhttps://github.com/Flyer53/jsPanel4/issues/204#issuecomment-1559270949, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACHRXR2OELDXBT3M3CL4DZTXHSXZZANCNFSM6AAAAAAYLVGGZU. You are receiving this because you are subscribed to this thread.Message ID: @.***>

External e-mail, be judicious when opening attachments or links

AviHafner avatar May 23 '23 13:05 AviHafner

@MadTomT If I understand your intention correctly the question is basically how to alter the content of an existing panel.

You could use the global method jsPanel.ajax() (or any other ajax library) to get the new content in order to add/append it to the existing panel in any way you want.

Flyer53 avatar May 25 '23 06:05 Flyer53

Thanks for the replies, Sorry if I wasn't clear.

Within my site are multiple hyper links. Normally if I open the site in a browser tab and click one of the hyper links the result page is opened within the same browser tab.

When I load my site in to a panel using contentAjax, it appears to load correctly, but when I click on a link the page is loaded in the browser tab not within the enclosing panel.

If I use iFrames instead of contentAjax it works, but I have concerns regarding security and iFrames.

Is there anyway for the links to be told to open within the active panel ?

Thanks

MadTomT avatar Nov 15 '23 11:11 MadTomT

Just to add to this, the pages also have forms with submit buttons. I need to find a way to keep all of this wrapped within the panel and not opening additional tabs.

Thanks

MadTomT avatar Nov 15 '23 12:11 MadTomT

@MadTomT A far as I understand your use case the iFrame is the best option in my opinion. Everything else would be quite complicated I guess. Not using iFrames it would not be enough to import html. You would have to do it in a way that makes the included js code executable after the import. And that js would then be parsed and part of the host page ... seems a lot more unsafe to me than using iFrames. In addition the imported js would build up with each page you load since the previously loaded js can't be unloaded again (just like a loaded script, you can remove the link from the page but you can't remove parsed js. Depending on how many pages you load it could result in a hell of a lot of essentially dead js in memory.).

Based on this I would not have any security concerns using iFrames. Since iFrames set up their own environment/execution context which is completely independent from the host page it should be pretty safe I think. In fact I think it's even more safe than another solution.

I hope I didn't mix up things completely. I didn't do any coding for quite a while ... 😏 Regards, Stefan

Flyer53 avatar Nov 16 '23 16:11 Flyer53