Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load external URL into Panel without iframe ? #204

Open
MadTomT opened this issue May 23, 2023 · 6 comments
Open

Load external URL into Panel without iframe ? #204

MadTomT opened this issue May 23, 2023 · 6 comments
Labels

Comments

@MadTomT
Copy link

MadTomT commented May 23, 2023

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
Copy link
Author

MadTomT commented May 23, 2023

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 ?

@AviHafner
Copy link

AviHafner commented May 23, 2023 via email

@Flyer53
Copy link
Owner

Flyer53 commented May 25, 2023

@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.

@MadTomT
Copy link
Author

MadTomT commented Nov 15, 2023

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
Copy link
Author

MadTomT commented Nov 15, 2023

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

@Flyer53
Copy link
Owner

Flyer53 commented Nov 16, 2023

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants