Auto reloading on save of template file in Quarkus? - quarkus

I know Quarkus has auto reload for resources and java files however, while editing a html template using the Qute templating engine you have to manually hit refresh in the browser. This can be a little tedious when making tons of small css changes.
Is there a way to have it when you save the resource it auto calls a refresh to your browser? Tried the LiveReload extension for chrome but I believe that is for local files instead of served files.

Related

SpringBoot2 how can I load newly added resources when running

I'm working on a web program.
In a controller, I create a picture using JfreeChart and save in /resources/image/.
But I can't load it on the web page immediately yet I can see the file under the directory. About 10s later, it can be loaded.
I'm not sure if I need to refresh resources in my code, And how should I refresh if needed.

Is it possible to programmatically reload JavaScript files in mobile browsers on page refresh?

I am developing a web application and while working on a desktop, I am used to force reloading pages using Ctrl-F5 in the browser to clear any cached copies when I make changes to javascript files.
I am not able to do that in mobile browsers since they don't have a Ctrl-F5 or forced reload feature. I want to refrain from using version numbers in the javascript's querystrings to force a reload files whenever I make changes.
Is there any client-side or server-side way to force a mobile browser to refresh javascripts when reloading a webpage?
Sure. The following method can be used to load in a JavaScript file programmatically.
function LoadJsFile(jsUrl)
{
var script = document.createElement("script");
script.setAttribute("type", "text/javascript");
script.setAttribute("src", request);
document.body.appendChild(script);
}

js and css cached in combres

I have implemented combres in my website (MVC3). The problem is everytime I change something in javascript I need to clear the browser cache to reflect my changes.
If any changes are there in js and css, the browser should automatically refresh the changes. (I don't want the cache to be disabled). Is there any way of doing it?

Making content accessible on Addon SDK

I am developing an addon using Firefox's Addon SDK (v. 1.11). My extension dynamically creates an iframe on each website and then loads an html file which includes other resources such as images, font files, etc. from the add on's local directory.
Problem
When loading any of such local resources (i.e.: "resource://" schema), the iframe fails to display them and a message is thrown:
Security Error: Content at http: //www.XXX may not load or link to
resource://XXX
This is a security measure introduced on Firefox 3. When developing without the Addon SDK, the way around it is declaring a directory with "contentaccessible=yes", making the directory's contents accessible to anyone, including my add on. However, I have not been able to find similar functionality using the Addon SDK. Is there a better way of using local data on an iframe that my addon creates and inserts into a page?
I don't think you can directly load an iFrame that points to a resource inside your URL. The browser complains because it's either breaking same origin policy or cross site scripting one. I can't remember which one right now.
if it is html content you want to load you can always inject it into the DOM and then send a message to the document object using the events API to display your custom html. I've done this in the past and it works.
so from main.js send a message to content script which will then inject your iframe html into the DOM and then you can send the document object a message to display it.
I hope this helps.
Not sure if this was the case when you posted the question, but it appears that "resource://" should no longer be used with the Addon SDK.
If you're using the resource inside of an HTML file in the extension, you can reference it locally, otherwise you should use data.url('whatever.jpg') and pass around that value as needed.
Full info is here: http://blog.mozilla.org/addons/2012/01/11/sdk-1-4-known-issue-with-hard-coding-resource-uris/

Changing the default URL for a PhoneGap project

A PhoneGap project, by default, loads a local HTML page that's in the "www" folder. I want to replace the default page with an external URL. How can I do that?
Well, it is theoretically possible by modifying the AppDelegate.m file in your project then having your www/index.html file immediately redirect to an external URL via JavaScript.
However, the main reason it isn't all that easy to do is that if you did do this Apple would almost certainly reject it as either loading remote JavaScript or as being nothing more than a wrapper for a website (both reject-able offences).

Resources