{% extends "base.html" %} {% block title %}{{ _('Debugger - ') + title }}{% endblock %} {% block init_script %} try { require( ['sources/generated/debugger', 'sources/pgadmin', 'sources/generated/codemirror'], function(pgDirectDebug, pgAdmin) { var pgDebug = window.pgAdmin.Tools.Debugger; pgDebug.load(document.getElementById('debugger-main-container'), {{ uniqueId }}, {{ debug_type }}, '{{ function_name_with_arguments }}', '{{layout|safe}}'); // Register unload event on window close. /* If opened in new tab, close the connection only on tab/window close and * not on refresh attempt because the user may cancel the reload */ if(window.opener) { $(window).on('unload', function(ev) { $.ajax({ method: 'DELETE', url: "{{ url_for('debugger.index') }}close/{{ uniqueId }}" }); }); } else { $(window).on('beforeunload', function(ev) { $.ajax({ method: 'DELETE', url: "{{ url_for('debugger.index') }}close/{{ uniqueId }}" }); }); } }, function() { console.log(arguments); }); } catch (err) { console.log(err); } {% endblock %} {% block body %} {% if is_desktop_mode and is_linux %} {% endif %}