在新的标签页中运行JavaScript [英] run javascript in overrided new tab page

查看:117
本文介绍了在新的标签页中运行JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了替换新的标签页,我已经写了一个小的扩展名。一切都很好,但一些JavaScript不会运行在我的本地html文件(它取代ntp)。
我全新的Chrome扩展。我想我错过了清单中的某些东西。有人可以帮帮我吗?
这里是我的清单

$ $ $ $ $ b $ chrome_url_overrides
{
newtab:inicio.html
},
description:Mostra una pagina vuota quando si apre una nuova s​​cheda,
incognito:split,
manifest_version:2,
name:Nuova Scheda Vuota,
version:1.0
}
pre>

index.html使用js文件夹中的一些xxx.js文件将文件记录到ext文件夹中

解决方案

我之前实际上做了一个扩展,我只是在inicio.html中添加了脚本。试试看。制作一个JavaScript文件并将其导入到您的html中。


i've written a little chrome extension in order to replace the new tab page. everythings is fine, but some javascript won't run on my local html file (which replaces ntp). i'm totally new to chrome extension. i think i miss something in the manifest. can someone please help me? here's my manifest

{
    "chrome_url_overrides": 
    {
        "newtab": "inicio.html"    
    },
    "description": "Mostra una pagina vuota quando si apre una nuova scheda",    
    "incognito":"split",    
    "manifest_version": 2,    
    "name": "Nuova Scheda Vuota",   
    "version": "1.0" 
}

index.html uses some xxx.js file in js folder beloging to ext folder

解决方案

I actually made an extension like this a while ago, and I simply added the script in inicio.html. Try that. Make a JavaScript file and import it into your html.

这篇关于在新的标签页中运行JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆