The owl carousel list does not display properly once laravel's spatie/CSP has been implemented

I have a owl carousel list of images:

 <div id="owl-demo" class="owl-carousel">
    <div class="item"><img src="{{URL::asset('img/app-screen/screen1.png')}}"></div>
    <div class="item"><img src="{{URL::asset('img/app-screen/screen2.png')}}"></div>
    <div class="item"><img src="{{URL::asset('img/app-screen/screen3.png')}}"></div>
    <div class="item"><img src="{{URL::asset('img/app-screen/screen4.png')}}"></div>
    <div class="item"><img src="{{URL::asset('img/app-screen/screen5.png')}}"></div>
    <div class="item"><img src="{{URL::asset('img/app-screen/screen6.png')}}"></div>
    <div class="item"><img src="{{URL::asset('img/app-screen/screen7.png')}}"></div>
    <div class="item"><img src="{{URL::asset('img/app-screen/screen2.png')}}"></div>
    <div class="item"><img src="{{URL::asset('img/app-screen/screen5.png')}}"></div>
    <div class="item"><img src="{{URL::asset('img/app-screen/screen1.png')}}"></div>
    <div class="item"><img src="{{URL::asset('img/app-screen/screen6.png')}}"></div>
</div>

which was functioning perfectly until I implemented CSP. I suspect there might be an issue with my rules (I am using laravel's spatie/laravel-csp package). Here are the rules I have defined:

 public function configure()
{
    $this->addDirective(Directive::BASE, Value::SELF)
        ->addDirective(Directive::CONNECT, Value::SELF)
        ->addDirective(Directive::DEFAULT, Value::SELF)
        ->addDirective(Directive::FORM_ACTION, Value::SELF)
        ->addDirective(Directive::IMG, Value::SELF)
        ->addDirective(Directive::MEDIA, Value::SELF)
        ->addDirective(Directive::OBJECT, Value::SELF)
        ->addDirective(Directive::SCRIPT, Value::SELF)
        ->addDirective(Directive::STYLE, Value::SELF);
}

Please note that owl carousel does not contain any inline code and all JavaScript and CSS files are stored in the project.

Answer №1

I needed to indicate that Value::UNSAFE_INLINE and SELF were necessary

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

I am experiencing difficulties connecting to Splunk using Javascript, but I am able to successfully connect with Java

Currently, I am attempting to establish a connection to Splunk using JavaScript. While I have successfully connected using Java and have full functionality, I keep encountering a 401 error when trying to connect with JavaScript. I am certain that my creden ...

Is there a way to automatically transfer the store's order value to my payment gateway's checkout process during the checkout process?

I am facing an issue with integrating the Razorpay payment gateway into my online store built on ecwid. The process involves decrypting order details from the store, sending them to the payment gateway for processing, and redirecting the customer back to t ...

Refreshing an AJAX call automatically in Knockout JS

Greetings everyone! I'm currently working on setting up a simple setInterval function to automatically refresh my data every minute. The line that is giving me trouble is: setInterval(incidentViewModel.fetchdata,60000); I also attempted this: windo ...

concerning a snippet of programming code

I'm new to coding and I'd like some help understanding this piece of code, particularly the red colored fonts. Which page value are they referring to? $(function() { $("#title").blur(function() { QuestionSuggestions(); }); }); funct ...

How can I ensure a mock is resolved before rendering in React with Jest?

By default, the loading state in my react component is set to true, and then it changes to false after a fetch call. Within my jsx code, I have a conditional check like {!loading && which functions correctly. However, during testing, the fetch call is mock ...

Using a variable as a parameter in a jQuery function

After selecting multiple options from a dropdown menu, I intended to use these selections as filters for my table rows. However, the code snippet below is not producing the desired results: <select name="courier" class="selectpicker courierpicker" mult ...

An issue has occurred in the node-telegram-bot-api module: Unable to locate 'fs', 'net', 'tls' in node-telegram-bot-api

<pre> import React, { Component } from "react"; import { render } from "react-dom"; import Home from "./components/Home.jsx"; const TelegramBot = require('node-telegram-bot-api'); const token = "MY_TOKEN"; const bot = new TelegramBot(token ...

Having trouble getting Vue Router's this.$router.push method to work within Vue component methods

When I try to log in, the login method is successful, but for some reason the route push using $router object is not working. Can someone provide assistance? This is my code snippet: doLogin(){ this.attemptLogin({...this.user}).then(function(){ ...

Aligning text in the middle vertically using a display:flex container

I am working on a calendar mobile webapp that utilizes jQuery Mobile Grid. Each cell in the grid may contain up to three blocks representing a schedule, which I want to expand to fill the parent cell using the display:flex property. However, I am having d ...

Fetching a substantial amount of data via AJAX to generate a graph

Currently, I am in the process of developing a server that will supply data and information to both a web client and a mobile client in the second phase. One of the key features is displaying this data on a graph, such as showing the price of a stock over ...

What is the best way to eliminate a vertical line from an HTML table?

I am looking to remove specific vertical lines from an HTML table. There are only 3 vertical lines in total, and I want to remove the first and third lines. Below is my code: <html> <head> <style type="text/css"> .table1{ background: ...

Mastering the Art of Parsing Complex JSON Data

I received a JSON output that looks like this. Using getjson, I'm trying to extract the datetime and value fields (italicized and bolded) such as [16:35:08,30.579 kbit/s],[16:35:38,23.345 kbit/s]. Is there any solution to achieve this? Thank you. { ...

Angular's ng-include functionality allows developers to dynamically load

As a beginner in angular.js, I've written my first 'hello world' script. I'm attempting to use ng-include to bring in a navbar from the local file /templates/nav.html. Despite following a tutorial closely, I'm struggling to underst ...

Utilize Laravel 5.3's chaining feature to paginate results following a filtering operation

$messages = Message::get()->filter(function($msg) use (&$year){ return Persian::jDate(...) == $year; })->sortByDesc('timestamp')->paginate(5); After adding paginate(5), I encountered an error "Method paginate does not exist." Ca ...

Guide on automatically attaching a file to an input file type field from a database

Currently, I am implementing a PHP file attachment feature to upload files. Upon successful upload, the system stores the filename with its respective extension in the database. The issue arises when trying to retrieve and display all entries from the ...

Attempting to utilize CSS to address a persistent problem in Chrome where the page orientation options briefly appear when printing before being hidden

I am struggling to print a webpage in landscape orientation using the chrome browser, but I don't have control over the page's settings. You can see the issue discussed here: Chrome Print dialogue not offering fit to page, landscape, other prin ...

When there is no content in the responseText, AJAX will display an error

I've encountered an issue while trying to fetch data using AJAX. The problem lies in receiving an empty responseText. Here's the code I'm working with: JavaScript: function getFounder(id) { var founder = ""; $.ajax({ ...

ReactJS select component failing to display accurate current value

My React custom Select component is not updating the selected value properly. Even though I select a new value from the dropdown, it still shows the old value. For example, if I choose '4' from the options, the handleChange function will receive ...

Navigate through an overflowing element in react/next

I have a component with a fixed width and overflow-x-auto. I want to hide the scroll bar and replace it with arrow buttons for scrolling left and right. How can I add this functionality to my component? Here is the code for my component: <div className ...

JavaScript - An Efficient Method to Retrieve Data Imported from the Controller via Ajax

I am a beginner and I'm having trouble getting a list of objects called "Event" (OrderId, Date) from the MVC controller to JavaScript in the view. When I try to display the list as strings, it shows me "undefined". On the controller side, everything ...