Skip to content

Commit af511c0

Browse files
committed
feat: Allow apps to toggle credentialless via Dev Center
1 parent 4dc1e01 commit af511c0

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

src/dev-center/js/dev-center.js

+13
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,11 @@ async function create_app(title, source_path = null, items = null) {
258258
maximizeOnStart: false,
259259
background: false,
260260
dedupeName: true,
261+
metadata: {
262+
window_resizable: true,
263+
credentialless: true,
264+
},
265+
261266
})
262267
.then(async (app) => {
263268
let app_dir;
@@ -568,6 +573,13 @@ function generate_edit_app_section(app) {
568573
<p>When locked, the app cannot be deleted. This is useful to prevent accidental deletion of important apps.</p>
569574
</div>
570575
576+
<h3 style="border-bottom: 1px solid #EEE; margin-top: 50px; margin-bottom: 0px;">Advanced</h3>
577+
<div style="margin-top:30px;">
578+
<input type="checkbox" id="edit-app-credentialless" name="edit-app-credentialless" value="true" ${(app.metadata?.credentialless === true || app.metadata === undefined || app.metadata.credentialless === undefined) ? 'checked' : ''}>
579+
<label for="edit-app-credentialless" style="display: inline;">Credentialless</label>
580+
<p><code>credentialless</code> attribute for the <code>iframe</code> tag.</p>
581+
</div>
582+
571583
<hr style="margin-top: 40px;">
572584
<button type="button" class="edit-app-save-btn button button-primary">Save</button>
573585
</form>
@@ -962,6 +974,7 @@ $(document).on('click', '.edit-app-save-btn', async function (e) {
962974
window_resizable: $('#edit-app-window-resizable').is(":checked"),
963975
hide_titlebar: $('#edit-app-hide-titlebar').is(":checked"),
964976
locked: $(`#edit-app-locked`).is(":checked") ?? false,
977+
credentialless: $(`#edit-app-credentialless`).is(":checked") ?? true,
965978
},
966979
filetypeAssociations: filetype_associations,
967980
}).then(async (app) => {

src/gui/src/UI/UIWindow.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ async function UIWindow(options) {
326326
frameborder="0"
327327
${options.iframe_url ? 'src="'+ html_encode(options.iframe_url)+'"' : ''}
328328
${options.iframe_srcdoc ? 'srcdoc="'+ html_encode(options.iframe_srcdoc) +'"' : ''}
329-
${window.co_isolation_enabled
329+
${(window.co_isolation_enabled && options.iframe_credentialless !== false)
330330
? 'credentialless '
331331
: ''
332332
}

src/gui/src/helpers/launch_app.js

+7
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,12 @@ const launch_app = async (options)=>{
301301
if(app_info.metadata?.hide_titlebar !== undefined && typeof app_info.metadata.hide_titlebar === 'boolean')
302302
hide_titlebar = app_info.metadata.hide_titlebar;
303303

304+
// credentialless
305+
let credentialless = true;
306+
if(app_info.metadata?.credentialless !== undefined && typeof app_info.metadata.credentialless === 'boolean')
307+
credentialless = app_info.metadata.credentialless;
308+
309+
console.log('credentialless', credentialless);
304310
// open window
305311
el_win = UIWindow({
306312
element_uuid: uuid,
@@ -316,6 +322,7 @@ const launch_app = async (options)=>{
316322
height: window_height,
317323
width: window_width,
318324
app: options.name,
325+
iframe_credentialless: credentialless,
319326
is_visible: ! app_info.background,
320327
is_maximized: options.maximized,
321328
is_fullpage: options.is_fullpage,

0 commit comments

Comments
 (0)