-
Notifications
You must be signed in to change notification settings - Fork 87
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
iframe src looking at root of webpage instead of iframe src directory (spa?) #54
Comments
which directory are you running |
I am running ws from the parent of "web_page". There are multiple pages I'm testing and "web_page" is one of them. |
if you running this command from the parent of "web_page", it will look for the file "index.html" in the same directory.. |
@75lb I think the default behaviour of the common static spa server is looking for nearest parent Actually for full step, with this author's setup. given that the request is
Could we have this behaviour instead? |
the syntax is ` --spa <filename>`, e.g. `--spa src/iframe/index.html`..
you specify which html file should be served as the SPA.. does that solve
your issue?
…On Thu, 10 Feb 2022, 04:26 Thaina Yu, ***@***.***> wrote:
@75lb <https://github.com/75lb> I think the default behaviour of the
common static spa server is looking for nearest parent index.html of the
url first. Which means with --spa command, it should serve
localhost:8000/web_page/iframe with
"localhost:8000/web_page/iframe/index.html"
Actually for full step, with this author's setup. given that the request
is localhost:8000/web_page/iframe
1. It should look for file web_page/iframe, if there is then serve as
is
2. If missing it should check if there is any folder web_page/iframe/
2.1. If there is, redirect to web_page/iframe/ (add the trailing / for
folder)
3. If there is web_page/iframe/index.html then serve that file
4. If there is web_page/index.html then serve that file
5. If there is index.html then serve that file
Could we have this behaviour instead?
—
Reply to this email directly, view it on GitHub
<#54 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJQV3HU7ARHYMYK5AYGJ53U2M457ANCNFSM4CUPDLWQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
It's not. Because then when I go to As I said, common spa static server, firebase for example, will always recursively look for the |
you can modify the spa behaviour to work in any way you like - it's just a
plugin which you can fork and tweak.. see the wiki for an explanation of
plugins, I'll get back to you with an example showing how to modify --spa
later
…On Thu, 10 Feb 2022, 05:27 Thaina Yu, ***@***.***> wrote:
you specify which html file should be served as the SPA.. does that solve
your issue?
It's not. Because then when I go to localhost:8000 it then still try to
serve src/iframe/index.html instead of src/index.html
As I said, common spa static server, firebase for example, will always
recursively look for the spa file of the parents recursively. This
behaviour let we host multiple app in each subdirectory
—
Reply to this email directly, view it on GitHub
<#54 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJQV3C5CGQK6IEWAMRZOA3U2NEFXANCNFSM4CUPDLWQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Thank you for your explanation. Still I would like to beg for you to consider this behaviour as default of the plugin so that it not confused and could be loaded from npm |
yes, that's a possibility too..
…On Thu, 10 Feb 2022, 06:04 Thaina Yu, ***@***.***> wrote:
Thank you for your explanation. Still I would like to beg for you to
consider this behaviour as default of the plugin so that it not confused
and could be loaded from npm
—
Reply to this email directly, view it on GitHub
<#54 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJQV3HXM4EVHMGZ4WEBLALU2NIPBANCNFSM4CUPDLWQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
The set up is like the following:
The HTML is:
<iframe src="iframe"></iframe>
I start the server using the following command line:
ws --spa index.html
The error I get is:
GET http://localhost:8000/iframe 404 (Not Found)
I think the expected behavior is for the relative path of the iframe src value of "iframe" to look in the subdirectory "localhost:8000/web_page/iframe" and use the spa of "index.html" as well as all the contents inside the iframe should have the relative path of the src value.
This does not seem to work with the following iframe src values:
This does seem to work with the following iframe src values:
The following partially works, but the relative path of the elements in the iframe seem to look in the parent directory, "localhost:8000/web_page", instead of "localhost:8000/web_page/iframe" (tries to serve "localhost:8000/web_page/scripts/some_script.js" instead of "localhost:8000/web_page/iframe/scripts/some_script.js").
(Sorry if I'm doing something dumb!)
The text was updated successfully, but these errors were encountered: