-
Notifications
You must be signed in to change notification settings - Fork 7
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
consult page context when resolving asset references #1
Comments
There are indeed interesting consequences for the way we share. I edited that item to include the protocol and domain name:
Here's how it looks as an external page: http://ward.asia.wiki.org/wiki.dbbs.co/framed And by contrast, here's how it looks as a local page: https://wiki.dbbs.co/view/framed I further experimented by visiting that page without https: (http://wiki.dbbs.co/view/framed) and learned that firefox enforces cross-origin policies even though both the main page and the framed content are under the same domain name. The protocol puts them in separate origins. I like your suggested markup. It allows us to smooth over these cross-origin wrinkles. |
Here is the code I use to construct the sharing The Frame plugin could ping each site in context order until it finds the first available version consistent with our sharing semantics. As you point out, there is no guarantee that the browser will grant the chosen file sufficient privilege to run. I plan to add to Assets some simple click that will copy a remote asset to the origin for logged in users thus elevating the file's privilege. This will be as if the user downloaded the remote file and then uploaded it to their own collected assets. I've been slow to implement this because I haven't decided what the click should be or how progress in the download should be shown. |
Rather than expanding the frame markup with knowledge about assets, I've opted to prevent authors from using site-relative links. I'm not opposed to expanding in that direction, but prefer to fix this immediate behavior more simply for the time being. |
It was also be nice to be very nice if site-relative links could include plugin paths, such as This will allow frame based tools to be bundled into a plugin for distribution. Rather that rely on some central source, and all the problem come with that (such as the http / https schism). |
I see that our plugin client code is fetched via similar paths. But about pages don't seem to be qualified other than by page naming convention. The Datalog plugin extends this routing with a server-side plugin that offers now-relative addressing. In this last case logs are written to a plugin and page specific location in the assets folder. These files can be directly addressed through our assets mechanism. We see a number of different cases here, all related to a plugin one way or another. Paul's suggestion is consistent with all of them while while rightfully segregating plugins, unlike about pages. We might go further and extend an open ended route for related content such as cooperating css and js files. Here assets refers to plugin specific assets installed along with the plugin. Assets would be an additional route in wiki.server that would be restricted to one level and be shipped with cors headers. |
Ward has been experimenting with interactions between html scripts inside frames and files inside of assets. The experiments reveal cases where the html script programmer needs information about three different web contexts: 1) the script itself can be hosted under one domain name, 2) the frame item on a wiki page under another domain name, and 3) the wiki origin holding a lineup of pages under a third domain name. item #1 can be gotten from window.location item #2 is in the "site" item #3 is new and given in the "origin"
This Frame says its subject page can't be found when it is clearly identified in the Assets plugin below.
http://wiki.dbbs.co/framed.html
The Frame plugin should use markup that more directly instructs the construction of reference urls. The CORS restrictions and associated security implications need to be thought through carefully. But the success of Frame and Assets will depend on our unique insight into sharing that is not widespread in the general (and possessive) web environment.
Perhaps the markup could use keywords to distinguish intentions
rather than the relative reference used
Once the proper logic has been developed it might make sense to incorporate it into the SiteAdapter API and thus encourage reference consistency across our suite of plugins. Improved asset handling in the Image plugin is right behind Frame in this regard. Please note, @paul90.
The text was updated successfully, but these errors were encountered: