Jump to content

Does it possible to load custom scripts to the TUniURLFrame?


Tokay

Recommended Posts

I need to load some scripts to such component berore it loads HTML.

I'm loaded html with such code: UniURLFrame1.HTML.Text := RenderHTML;

It's needed to load 3-4 scripts into Iframe before HTML for using they into HTML.

Link to comment
Share on other sites

hi. we have html templates with script tag inside
<script src="/uni-1.90.0.1562/pdf2/qrcode.min.js"></script>

we put script to c:\Program Files (x86)\FMSoft\Framework\uniGUI\uni-1.90.0.1551\pdf2\qrcode.min.js
but after update unigui to 1562 that script no longer loads.

where do we need to put the file so that it is always loaded after updating unigui?

Link to comment
Share on other sites

2 hours ago, Tokay said:

Two or more software could get access, not just users.

hello,

1. if your server is on Windows. Try to use ActiveDirectory.

2. You can also use these scripts as a resource in the application and load them in html and you can even patch the application to update your scripts (resources).

https://stackoverflow.com/questions/7815291/how-can-a-program-change-its-own-resources

3. You can check the hash of the script files before loading, so if changes have been made, you won't load the script.

4. You can encrypt script files and nobody will change them, but you won't be able to use them directly in <script src="/uni-1.90.0.1562/pdf2/qrcode.min.js"></script>

Link to comment
Share on other sites

Does it possible to add one customized additional folder for custom scripts? Folder should not be related to any UniGUI folder. We have for now three external folders that we should to store in the "C:\Program Files (x86)\FMSoft\Framework\uniGUI\uni-1.90.0.1562\" folder. We've rewrite your runtime installator from scratch in order to be able put our customised scripts to the system protected folder. It's really huge work, but we done it because the UniGUI does not provide such mechanism.

Ideal way for us is to add additional folder here (TUniGUIServerModule.HandleFileRequest) :

  if LocalDoc = '' then
     LocalDoc := ExpandFilename(ActiveServerRoot + ADoc);
  if LocalDoc = '' then
     LocalDoc := ExpandFilename(CustomFolder + ADoc); //new folder
 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...