分类 默认分类 下的文章
安卓常用apk
功能 | app |
---|---|
应用多开 | shelter |
debian add program to desktop app list
assume webstorm program location /opt/webstorm
sudo vim /usr/share/applications/webstorm.desktop
type in
[Desktop Entry]
Name=webstorm
Comment=Run My Program
Exec=/opt/webstorm/bin/webstorm
Icon=/opt/webstorm/icon.png
Terminal=false
Type=Application
Categories=Utility;Application;
chrome扩展动态修改header csp
manifest.json
{
"name": "__MSG_name__",
"default_locale": "en",
"version": "1.0.0",
"manifest_version": 3,
"description": "__MSG_description__",
"background": {
"service_worker": "background.js"
},
"permissions": [
"declarativeNetRequest",
"declarativeNetRequestWithHostAccess"
],
"host_permissions": [
"*://*/*"
]
}
background.js
// 生成动态规则函数
const createCspRule = (extensionId) => ({
id: 1001,
priority: 1001,
action: {
type: "modifyHeaders",
responseHeaders: [
{
header: "Content-Security-Policy",
operation: "set",
value: `frame-ancestors 'self' chrome-extension://${extensionId}`
},
{ header: "X-Frame-Options", operation: "remove" }
]
},
condition: {
urlFilter: "|*://*/*",
resourceTypes: ["sub_frame"]
}
});
// 安装时更新规则
chrome.runtime.onInstalled.addListener(async () => {
const extensionId = chrome.runtime.id;
await chrome.declarativeNetRequest.updateDynamicRules({
removeRuleIds: [1001],
addRules: [createCspRule(extensionId)]
});
console.log('动态规则已更新,当前扩展ID:', extensionId);
});
git常用操作
删除tag
# 删除本地tag
git tag --delete tagName
# 删除远程tag
git push origin --delete tag tagName
删除分支
# 删除本地分支
git tag --delete branchName
# 删除远程分支
git push origin --delete branchName