小编Bin*_*y C的帖子

chrome.browserAction.onClicked.addListener不工作

我正在创建Chrome扩展程序,但我的浏览器操作无效.

我的Manifest.jason

 {
    "name": "TypoSaurus",
    "version": "0",
    "description": "TypoSaurus extension",
    "background": {
        "page": "background.html"
    },
    "manifest_version": 2,
    "browser_action": {
        "name": "TypoSaurus",
        "icons": ["icon.png"],
        "default_icon": "icon.png"
    },
    "content_scripts": [{
            "js": ["jquery-2.0.2.min.js", "background.js"],
            "css": ["customStyles.css"],
            "matches": ["http://*/*", "https://*/*"]
        }],
    "permissions": ["<all_urls>"]
}
Run Code Online (Sandbox Code Playgroud)

和我的background.js

function typo (tab) {

  alert('test');
}

chrome.browserAction.onClicked.addListener(typo);
Run Code Online (Sandbox Code Playgroud)

我收到的错误是

未捕获的TypeError:无法读取未定义的属性'onClicked'

javascript jquery google-chrome google-chrome-extension

4
推荐指数
1
解决办法
5406
查看次数

旋转7次然后轻松

你好我试图动画一个元素,使它旋转7次然后减速和缓解我完成旋转我只需要缓解它.我正在使用from和to keyframe来旋转它,我需要逐帧进行还是有另一种方式?

@keyframes spin {
    from {
        transform:rotate(0deg);
    }
    to {
        transform:rotate(360deg);
    }
}
.spin.animated {
    animation-name: spin;
    animation-duration: 400ms;
    animation-iteration-count: 7;
    animation-timing-function: linear;
}
Run Code Online (Sandbox Code Playgroud)

css css3 css-animations

0
推荐指数
1
解决办法
2529
查看次数