Chrome content script does not load in about:blank page

后端 未结 2 649
小鲜肉
小鲜肉 2021-01-19 01:24

I am developing a Chrome extension which will load content script according to the following manifest:

\"content_scripts\" : [
    {
      \"matches\" : [ \"         


        
2条回答
  •  孤街浪徒
    2021-01-19 01:50

    Update: As of Chrome 37 (August 26, 2014), you can set the match_about_blank flagDoc to true to fire for about:blank pages.

    See alib_15's answer below.



    For Chrome prior to version 37:

    You cannot load a Chrome content script (or userscript) on about:blank pages.

    This is because about: is not one of the "permitted schemes". From chrome extensions Match Patterns:

    A match pattern is essentially a URL that begins with a permitted scheme (http, https, file, ftp, or chrome-extension)...


    In this case, you might be better off hijacking makewindow().

提交回复
热议问题