44 questions
0
votes
1
answer
51
views
Sinatra app Content Security Policy nonce for inline script not working
In my very simple Sinatra app I have a home page on which there is form which needs to be submitted through AJAX and the HAML template needs to execute some JS code. And I need to set the Content-...
0
votes
1
answer
120
views
Unable to use DefaultAzureCredential in inline C# script of Azure Logic App (Standard)
I’m running an inline C# script in an Azure Logic Apps workflows to get the blob details using DefaultAzureCredential(). I have given 'Storage Blob Data Contributor' to Azure Logic App in Storage ...
1
vote
0
answers
44
views
Copy Image Into Chrome Browser's Clipboard for MacOS, Windows, Ubuntu
I am trying to copy an image into browser's(specifically chrome) clipboard for later paste via ctrl + v or cmd + v. I tried 2 different way to implement that feature but failed. And note that this is ...
1
vote
1
answer
399
views
inline event handler nested within a javascript - Refused to execute inline event handler because it violates the following Content Security Policy
Preface: Hashes belonging to all known or identifiable Javascripts have been included in the CSP Header.
When I click on the custom Facebook share button, I get the following error:
Refused to ...
0
votes
0
answers
277
views
SvelteKit: social media widget inline scripts fail CSP
I'm trying to add a page to my website that allows users to view all of my social media feeds in one place. All three social media sites that I'm using (Facebook, Instagram and Pinterest) offer ...
5
votes
0
answers
3k
views
How can I fix jQuery 3.7.0 inline script violation with CSP
jQuery 3.7.0. has a line of code that violates CSP policies for inline scripting that has been persisting since version 3.1.1, seeing as it is clearly not getting fixed anytime soon I was wondering if ...
2
votes
2
answers
138
views
Changing text and picture with one button using Javascript
So I've created a very basic practice page, where clicking each button will bring up a picture of the country. Below the picture is some text.
My question is, how do you go about making the text below ...
1
vote
2
answers
3k
views
Yaml parameter to inline script
Hello I think the problem I am facing might be a beginner doubt, but here it is:
I have a stage yaml which is called by my main yaml. Stage yaml has a parameter which I want to use in inline script.
...
0
votes
2
answers
422
views
Azure CLI Task Yaml
I am trying to execute Get-AzSqlServer from AzureCli@2 yaml pipeline and it is throwing an error:
The term 'Get-AzSqlServer ' is not recognized as the name of a cmdlet
Here is my task
- task: AzureCli@...
0
votes
1
answer
949
views
Expose Functions Using Webpack & Then Call Them From an Inline Script
I'm working on getting a bunch of legacy inline scripts cleaned up.
My question is: How do I call a function from an inline script that is compiled in WebPack.
After trying a bunch of different ...
0
votes
0
answers
26
views
Refused to execute inline script in Manifest V3 extension [duplicate]
I'm building a Chrome extension using Manifest V3, and I'm trying to execute an inline script using chrome.scripting.executeScript(). However, I keep getting the error message "Refused to execute ...
0
votes
2
answers
2k
views
Tailwind CSS IntelliSense in Visual Studio Code does not provide suggestions in an inline script?
I am trying to get the TailwindCSS IntelliSense working inside an inline script. I am using handlebars in a simple One-Pager, however the autocompletion doesn't work in side the script tag.
<div id=...
0
votes
1
answer
357
views
ARM template deploying an azureKeyVault and retrieving an objectId using an inline Powershell script. Not happening for me
I'm thinking this is the best place to post this as you guys are the cream of the crop. I'm very new to azure Devops and I am playing around ARM templates and have created a relatively simple ...
1
vote
0
answers
1k
views
Content Security Policy (CSP) with unsafe-hashes is not working on mozilla firefox
I used the unsafe-hashes for our Content-Security-Policy to override the errors for our html inline attached events, so in Chrome it works fine and scripts like this are working properly:
<a id=&...
1
vote
1
answer
219
views
Content Security Policy self blocking inline
In my experience, the header below, when enabled, blocks inline script on the page.
Content-Security-Policy: default-src 'self'.
Why is inline code not considered "self"?
I know I can use ...
0
votes
0
answers
966
views
How to inject inline script when Content Security Policy is preventing it?
I'm using Chrome Extension ReactJS which I'd like to insert this in popup.html:
<script src="https://unpkg.com/[email protected]/build/index.js"></script>
<script>
...
5
votes
1
answer
13k
views
Which directive is better between nonce and hash for CSP header to avoid unsafe-inline?
I have to add CSP header to a site. Issue is that this is a legacy code and there are lots of inline scripts and styles in the HTML. I cannot use 'unsafe-inline' as the aim is to actually make the ...
0
votes
1
answer
278
views
How to translate inline javascript?
So I'm working on a django project and we're having English translated to Czech (not important). I can do fine with regular tags being translated with {% trans 'sample text' %}
However, I have a ...
0
votes
0
answers
317
views
How to use PATS to execute a powershell file from an Inline Powershell Script in TFS Build Definition
I'm trying to execute a powershell script XYZ.ps from an Powershell task which is in a TFS Build Definition. The Build Definition is executed with UserA and this UserA does not have permission to Read/...
-2
votes
1
answer
11k
views
how to disable Content Security Policy and stay secure? [closed]
i want to disable the CSP - app.use(helmet.contentSecurityPolicy()) because it blocks any inline-scripts. the hash and nonce solutions (https://content-security-policy.com/examples/allow-inline-script/...
0
votes
1
answer
332
views
Combine js files into one and make it inline script
How can i combine multiple JavaScript files into one and make it inline script.
Currently I can combine into one file using gulp usemin but i can't do it as inline script .
I want to solve render ...
5
votes
1
answer
3k
views
Inline-script hash or nonce not accepted by CSP
I am developing a Flask App and it uses Flask-Talisman to incorporate a CSP. I wanted to create an inline script in one of my templates and instead of adding 'unsafe-inline' to the 'script-src' array ...
3
votes
2
answers
2k
views
Why does my code violate the Content Security Policy?
I want to defer non-critical css using the following mechanism:
<link rel="preload" href="styles.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
I have the following Content ...
0
votes
0
answers
656
views
Expose JavaScript Module's Function to Entire HTML Document
Consider this basic function in /js/foo.mjs:
export function foo( ) {
console.log('Hello, Modularity!');
};
How to import foo function inside an HTML document, so it can be used inline?
<html&...
8
votes
3
answers
2k
views
Django stripe js blocking of inline script
I'm trying to implement stripe payment system in Django. For adding card payments, I followed the guide in this link. After adding HTML markup in Django template and CSS and JS code as separate static ...
0
votes
1
answer
1k
views
Insert inline script to the index.html with env variable
I have index.html where I want to load hotjar tracking code (only inline script), but it depends on the env variable.
I tried to use webpack DefinePlugin
new webpack.DefinePlugin({
'process....
0
votes
2
answers
262
views
Why Go.js doesn't work with inline script?
I have an application that cannot use external scripts references. I've always being able to use any kind of script putting it inline, but with go.js it has not being possible. Is there any particular ...
1
vote
4
answers
235
views
A different angle on How to write html code inside php?
We write PHP code inside the HTML code via <?php ... ?> tags. So normally it would not make sense to write HTML code inside PHP code that is already inside HTML code, if you can just exit the ...
0
votes
0
answers
448
views
Inject html in popup html on load
I am trying to inject html snippet in chrome extension (popup.html). The most convenient way seems to me is
<script>
$(function(){
$('body').load("login.html");
});
</script&...
1
vote
1
answer
467
views
Add inline Javascripts on Wordpress
I want to add inline Javascript on footer of my wordpress site. I know we can add inline Javascript using wp_add_inline_script. From my understanding from Codex tutorial, we have to register and ...
0
votes
1
answer
891
views
Execute shell script present in host machine path in vagrant
My Vagrantfile is
$script = <<SCRIPT
cd /opt/IBM/WebSphere/AppServer/
sudo sh startServer.sh server1
SCRIPT
Vagrant.configure(2) do |config|
config.vm.box = "bolbase"
config.vm.network "...
1
vote
2
answers
5k
views
add an item to arraylist in powershell workflow foreach -parallel
How can we add an item to an arraylist while using foreach -parallel loop in powershell workflows?
workflow foreachpsptest {
param([string[]]$list)
$newList = [System.Collections.ArrayList]@()
...
0
votes
1
answer
2k
views
Mitmproxy: Tampering with get request: Replace all instances of string "data: 123" in request with script
I am working with mitmproxy, and I am still fairly new to it (been using it for a couple of days). Right now I am attempting to intercept get requests, and replace all instances of a string, for ...
4
votes
1
answer
16k
views
Mitmproxy tampering with GET and POST request/ response in one script
A POST request sent to a certain URL (http://test.com) looks like this:
{
"messageType": "OK",
"city": {
"Name": "Paris",
&...
1
vote
0
answers
1k
views
Inline script that calls a function in an external script using document.write
Say I have a script called makeFields.js which includes the method
function makeDateControls() {
document.write(/* ... */);
}
In my HTML, I link to that script in the head, like so:
<head&...
1
vote
3
answers
1k
views
jquery - function not defined - calling this function from inline script
I have the code as shown below. Have removed unwanted code from this, just wrote what was needed. When I call my toggleFunc from inline script in body, it shown in console that this function is not ...
8
votes
1
answer
4k
views
Why are inline JS blocks unsafe?
I'm reading Chrome extension document "Content Security Policy (CSP)". It says:
Inline JavaScript, as well as dangerous string-to-JavaScript methods
like eval, will not be executed. This ...
1
vote
10
answers
7k
views
How to print a line of HTML markup containing inline javascript and nested quoting?
How should I quote this:
<tr onclick="$.colorbox({href:'information1.html'});">
When put in an echo " "; ?
I have tried this:
echo "<tr onclick='$.colorbox({href:'...
1
vote
1
answer
2k
views
dojo.xhrGet(): how to execute inline javascript?
simple question: How do I execute inline javascript in a HTML page snippet loaded with dojo.xhrGet()?
Being new to dojo I'm a bit confused this doesn't just work like in JQuery ...
Can anyone help??
...
1
vote
3
answers
413
views
Ajax jQuery Best practices: avoid inline script?? then how do I pass variables
I just read in a best practices article for jquery and ajax that I should avoid defining behavior for elements on the page with inline script. That does make sense since it makes the code very ...
16
votes
0
answers
5k
views
What if script tag has both "src" and inline script? [duplicate]
I am wondering what if one script tag has both "src" and inline script. I tried below code.
<script src="http://yui.yahooapis.com/2.8.1/build/yahoo/yahoo-min.js" type="text/javascript" charset="...
1
vote
1
answer
505
views
jQuery.load() with AJAX Kontactr form
After seeing many questions about how jQuery.load() handles tags in the content to be loaded, I see that jQuery strips out inline tags. But, I'd like to use Kontactr for the contact page in my site, ...
0
votes
1
answer
68
views
Changes HTML attr with inline scripting
I was trying to do this :
<asp:GridView ID="gvBugList" runat="server" AutoGenerateColumns="False" ShowHeader="False"
DataSourceID="linqDSBugList" Width="100%" AllowPaging="true" PageSize="...
2
votes
2
answers
3k
views
Inline scripting in ASP.NET
I want to learn advanced and basic things about ASP.NET inline scripting like
<img src="<%= Page.ResolveUrl("~")%>Images/Logo.gif"/>
or
<asp:Label ID="lblDesc" runat="server" Text='&...