user2988257
user2988257

Reputation: 962

Embed iframe/panel into Jenkins

I have some external web service running (actually it just several web pages) and I'm looking for a way how to embed this system as a panel inside Jenkins (probably as iframe).

Checked thru Jenkins plugins but found nothing.

Example view of what I look for:

enter image description here

Upvotes: 2

Views: 6018

Answers (1)

user1908704
user1908704

Reputation: 176

I just looked into this for a job-specific iframe. You can add the iframe in the description field of a job, but you need to jump through some hoops to turn down the HTML sanitisation (which has security implications):

  1. Install the 'anything goes' plugin
  2. Go into 'Configure global security' and select the Markup Formatter to be 'Allow Arbitrary HTML including Javascript (UNSAFE)'
  3. Edit the job and add some HTML into the description field:

    <h2>HTML description demo</h2>
    <iframe src="https://www.example.com"></iframe>
    
  4. Adjust the Jenkins Content Security Policy to allow access to the site(s) you want. For example:

    System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "child-src 'self' www.example.com")
    

Result:

enter image description here

Upvotes: 3

Related Questions