当前位置:网站首页>chrome extension: how to make the dialog be on the right side of the current window?
chrome extension: how to make the dialog be on the right side of the current window?
2022-07-30 20:33:00 【music】
chrome扩展:How can I make the dialog be on the right side of the current window?
本文介绍了chrome扩展: How to make the extension dialog be located on the right side of the current window.
chrome.action.onClicked.addListener(async function(tab){
var windows = await chrome.windows.getAll({
populate: true, windowTypes: ["popup"]}) || []
// My processing here is that only one dialog box can be displayed,Each time it is judged whether there is an existing dialog box,If there is, take the last dialog to give focus
if(windows.length > 0){
var lastFoucsedWindow = await chrome.windows.getLastFocused({
populate: true, windowTypes: ["popup"]
})
if(!lastFoucsedWindow.focused){
chrome.windows.update(lastFoucsedWindow.id, {
focused: true});
}
}else{
chrome.windows.getCurrent(function(w) {
// w The parameter contains information about the browser window,如 高度、宽度 ...
chrome.windows.create({
tabId: tab.id,url: "popup.html", type: "popup", width:340,height:610,top: 80,left: (w.width - 450)});
});
}
})
边栏推荐
- Can't find the distributed lock of Redisson?
- 5分钟搞懂MySQL - 行转列
- MySQL——几种常见的嵌套查询
- HJ85 最长回文子串
- YOLO V3详解
- C language: detailed explanation of operators
- Weak Banks to data conversion ability?Matt software help solve bank dilemma
- 7.联合索引(最左前缀原则)
- 【PM专用】快速统计团队还有谁没有登记上报信息,快速筛选出属于自己项目组的成员,未完成XXX工作事项的名单
- Recommendation System - Sorting Layer: Sorting Layer Architecture [User and Item Feature Processing Steps]
猜你喜欢

TensorFlow2: Overview

多线程获取官方汇率

GateWay实现负载均衡
![Recommendation system: evaluation index [offline evaluation index: RMSE (root mean square error), AUC, precision, recall, F1] [online evaluation: A/B test] [generally required response time <0.5s]](/img/ff/9c49d38a655e3f7f221b219d5069c9.png)
Recommendation system: evaluation index [offline evaluation index: RMSE (root mean square error), AUC, precision, recall, F1] [online evaluation: A/B test] [generally required response time <0.5s]

MySQL 视图(详解)

Ordinary int main(){} does not write return 0; what will happen?

基于Apache Doris的湖仓分析

360杜跃进:太空安全风险加剧,需打造一体化防御体系

MYSQL JDBC图书管理系统

MySQL的on duplicate key update 的使用
随机推荐
对一次生产环境产生OOM的记录,结论:除非在自己完全有把握的情况下,否则不要偷懒查询无用字段
canvas基础讲解加示例
推荐系统-模型:FNN模型(FM+MLP=FNN)
c语言:操作符详解
MySQL8重置root账户密码图文教程
推荐系统:开源项目/工具【谷歌:TensorFlow Recommenders】【Facebook:TorchRec】【百度:Graph4Rec】【阿里:DeepRec和EasyRec】
Multi-threaded mutex application RAII mechanism
基于Apache Doris的湖仓分析
想要写出好的测试用例,先要学会测试设计
excel数字如何转换成文本?excel表格数据转换成文本的方法
To the operation of the int variable assignment is atom?
普通的int main(){}没有写return 0;会怎么样?
Zabbix部署与练习
【考研词汇训练营】Day18 —— amount,max,consider,account,actual,eliminate,letter,significant,embarrass,collapse
MySQL 删除表数据,重置自增 id 为 0 的两个方式
软考 --- 数据库(6)数据仓库、分布式数据库
GateWay实现负载均衡
MySql密码
MySQL数据库字段超长问题
推荐系统:AB测试(AB Test)