镀铬扩展许可?

时间:2018-03-13 18:39:23

标签: google-chrome google-chrome-extension google-chrome-app

我有后台JS脚本,写在Angular 2上。当我运行扩展时,我收到了这个权限通知:

package com.ltg.book.config.routing;

import static org.springframework.web.reactive.function.server.RequestPredicates.GET;
import static org.springframework.web.reactive.function.server.RouterFunctions.route;
import static org.springframework.web.reactive.function.server.RouterFunctions.toWebHandler;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.server.reactive.HttpHandler;
import org.springframework.http.server.reactive.TomcatHttpHandlerAdapter;
import org.springframework.web.reactive.config.CorsRegistry;
import org.springframework.web.reactive.config.EnableWebFlux;
import org.springframework.web.reactive.config.WebFluxConfigurer;
import org.springframework.web.reactive.function.client.WebClient;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.ServerResponse;
import org.springframework.web.server.adapter.WebHttpHandlerBuilder;

import com.ltg.book.exception.ErrorHandler;
import com.ltg.book.handlers.BookServiceHandler;

@Configuration
@EnableWebFlux
public class RoutingConfiguration implements WebFluxConfigurer {

    @Autowired
    private ApplicationContext appContext;

    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**").allowedMethods("GET", "POST", "DELETE", "PUT", "HEAD");
    }

    @Bean
    public RouterFunction<ServerResponse> bookRoutes() {
      BookServiceHandler bookServiceHandler =  appContext.getBean(BookServiceHandler.class);
    return route (GET("/v1/books/{bookId}/metadata"), bookServiceHandler :: getBookMatadata)
         .andRoute (GET("/v1/books/{bookId}/details"), bookServiceHandler :: getBookDetails)
         .andRoute (GET("/v1/books/{bookId}/profile"), bookServiceHandler :: getBookProfile);
    }

    @Bean
    ErrorHandler errorHandler() {
        return new ErrorHandler();
    }

    @Bean WebClient webClient() {
      return WebClient.create();
    }


    @Bean
    public ServletRegistrationBean<TomcatHttpHandlerAdapter> servletRegistrationBean() {
        HttpHandler httpHandler = WebHttpHandlerBuilder
          .webHandler(toWebHandler(bookRoutes()))
          .build();
        ServletRegistrationBean<TomcatHttpHandlerAdapter> registrationBean
          = new ServletRegistrationBean<>(new TomcatHttpHandlerAdapter(httpHandler), "/");
        registrationBean.setLoadOnStartup(1);
        registrationBean.setAsyncSupported(true);
        return registrationBean;
    }

}

compiler.js:34069 Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:". 是:

manifestfile

我应该做哪些改变?

0 个答案:

没有答案