How do I generate a glTF file and then include it in a link and open it in AR using Android Scene Viewer?

I am trying to generate a glTF file from a custom 3D glTF configurator I am building. The file is being generated and I can download it without a problem if I use link.href = URL.createObjectURL( blob ); and link.download = filename; in the save(blob) function. However what I am trying to do is to first generate the glTF file and then concatenate it in the link.href so instead of just downloading the glTF file to be able to open it in AR using Google Scene Viewer on an Android mobile device. Unfortunately when I am calling the exportGLTF() function the browser crashes! Any ideas of what I am doing wrong?

Here is the code I am using:

  var link = document.createElement('a');
  link.style.display = 'none';

  function exportGLTF() {
    var gltfExporter = new GLTFExporter();

    gltfExporter.parse(
      scene,
      function (result) {
        var output = JSON.stringify(result, null, 2);
        saveString(output, 'scene.gltf');
      },
      options
    );
  }

  function saveString(text, filename) {
    save(new Blob([text], { type: 'application/json' }), filename);
  }

  function save(blob) {
    link.href =
      'intent://arvr.google.com/scene-viewer/1.1?file=' + URL.createObjectURL(blob) + '&mode=ar_only#Intent;scheme=https;package=com.google.ar.core;action=android.intent.action.VIEW;end';
    link.click();
  }