Skip to content

Mac Chrome got crashed frequently #4368

Closed
@MongooseSong

Description

Mac OS Version: 12.2.1 (21D62)
Chrome Version: 109.0.5414.87

Details

  • Browser and browser version: Chrome 109.0.5414.87
  • OS version: Mac Monterey 12.2.1 (21D62)
  • xterm.js version: 4.1 / 5.0 / 5.1

Steps to reproduce

Main Codes here:

<script src="//{{.CDN_ROOT}}/xterm/5.1.0/xterm.js"></script>
<script src="//{{.CDN_ROOT}}/xterm/5.1.0/addons/attach/xterm-addon-attach.js"></script>
<script src="//{{.CDN_ROOT}}/xterm/5.1.0/addons/fit/xterm-addon-fit.js"></script>
<script src="//{{.CDN_ROOT}}/xterm/5.1.0/addons/webgl/xterm-addon-webgl.js"></script>
<script src="//{{.CDN_ROOT}}/xterm/5.1.0/addons/search/xterm-addon-search.js" type="application/javascript"></script>



var ws = new WebSocket('{{.WEBSOCKET_URI}}');
const fitAddon = new FitAddon.FitAddon();
const searcher = new SearchAddon.SearchAddon();
const webgl = new WebglAddon.WebglAddon();
term.loadAddon(new AttachAddon.AttachAddon(ws));
term.loadAddon(searcher);
term.loadAddon(fitAddon);

function debounce(fn, wait) {
	var timeout = null;
	return function() {
		if(timeout !== null) {
				clearTimeout(timeout);
		}
		timeout = setTimeout(fn, wait);  
	}
}
				

ws.onclose = function () {
    if (!openned) {
        term.write("\n\n\r\033[1;3;31mclosed by remote. Check if you are using a http proxy likes charles and .etc .\033[0m")
    } else {
        term.write("\n\n\r\033[1;3;31mclosed by remote\033[0m")
    }
};

ws.onopen = function() { 
	fitAddon.fit(); 
	fetch('{{.CONTROL_URI}}&w=' + String(term.cols) + "&h=" + String(term.rows),{
		method: 'GET',
		credentials: 'include'
	}).then(result => {
		// console.log(result);
	}).catch(error => {
		console.error(error);	
	});
	openned = true; 
	term.focus(); 
};

term.open(document.getElementById('terminal'), true);
term.loadAddon(webgl);
webgl.onContextLoss = function() {
		addon.dispose();
};

The situtation is often, or with high probability, when the first character is typed, the whole Chrome Browser will crash,with no message left.

I am not sure whether it is a bug of chrome or not, It is never happened in Chrome Canary, But it last for a long time(since 2022.9), So I just went here for any thought.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions