Tokay Posted July 26, 2022 Share Posted July 26, 2022 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. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 26, 2022 Share Posted July 26, 2022 10 minutes ago, Tokay said: RenderHTML <head> <script src="files/customcode.js"></script> </head> ? Quote Link to comment Share on other sites More sharing options...
Wizard Posted July 26, 2022 Share Posted July 26, 2022 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? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 26, 2022 Share Posted July 26, 2022 1 minute ago, Wizard said: where do we need to put the file so that it is always loaded after updating unigui? Hello, You need move your scripts to the files folder for example. Quote Link to comment Share on other sites More sharing options...
Tokay Posted July 26, 2022 Author Share Posted July 26, 2022 This is exactly our issue! We could not put scripts to the program data for the safety reason. Also is hard to insert links on the RenderHTML. Quote Link to comment Share on other sites More sharing options...
Tokay Posted July 26, 2022 Author Share Posted July 26, 2022 2 minutes ago, Sherzod said: Hello, You need move your scripts to the files folder for example. It greatly worsens common safety: in such folder any user could change any files. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 26, 2022 Share Posted July 26, 2022 4 minutes ago, Tokay said: We could not put scripts to the program data for the safety reason. Okay. But how else, you still want to load the scripts, right? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 26, 2022 Share Posted July 26, 2022 1 minute ago, Tokay said: It greatly worsens common safety: in such folder any user could change any files. How?! Quote Link to comment Share on other sites More sharing options...
Tokay Posted July 26, 2022 Author Share Posted July 26, 2022 Just now, Sherzod said: How?! Normally program data is the common folder for all users and has full access to any user Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 26, 2022 Share Posted July 26, 2022 1 minute ago, Tokay said: Normally program data is the common folder for all users and has full access to any user Well, maybe, if you give access to the server... Quote Link to comment Share on other sites More sharing options...
Tokay Posted July 26, 2022 Author Share Posted July 26, 2022 2 minutes ago, Sherzod said: Well, maybe, if you give access to the server... Two or more software could get access, not just users. Quote Link to comment Share on other sites More sharing options...
irigsoft Posted July 26, 2022 Share Posted July 26, 2022 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> Quote Link to comment Share on other sites More sharing options...
Tokay Posted July 26, 2022 Author Share Posted July 26, 2022 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.