rod icon indicating copy to clipboard operation
rod copied to clipboard

prevent the user from creating new tabs or closing them and how to create tab groups

Open Fitrad3w opened this issue 1 year ago • 6 comments

hi, can I prevent the user from creating new tabs or closing them, if not, how can I pin tabs?

Fitrad3w avatar Mar 18 '23 12:03 Fitrad3w

and how to create tab groups?

Fitrad3w avatar Mar 18 '23 19:03 Fitrad3w

Please add a valid Rod Version: v0.0.0 to your issue. Current version is v0.112.6

generated by check-issue

rod-robot avatar Mar 18 '23 19:03 rod-robot

cdp doesn't have api to pin tabs or create tab groups

https://chromedevtools.github.io/devtools-protocol/

ysmood avatar Mar 19 '23 07:03 ysmood

you can listen some Events to prevent user create new tab

go browser.EachEvents(

// listen targetCreated Events
func () {
// 1.get current pages num 
// 2.if num > maxPageNum then close the new target
},
)

Fly-Playgroud avatar Mar 20 '23 14:03 Fly-Playgroud

@ysmood https://stackoverflow.com/a/60174894 can this be replicated in GoLang?

caner-cetin avatar Mar 27 '23 08:03 caner-cetin

https://github.com/go-rod/rod/issues/830#issuecomment-1462874270 You can override variables like this with Rod, I am forcing the page to be visible in this comment. Maybe something similar can be done on forcing window's open tab behavior

caner-cetin avatar Mar 27 '23 08:03 caner-cetin