Skip to content

fix/integrity-crossorigin-props #595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 4.0.3

_Fixes:_

- Added the integrity and crossorigin properties for the scripts in the `public/index.js` file.

# 4.0.2

_Hotfix_:
Expand Down
2 changes: 0 additions & 2 deletions dist/index.cjs

This file was deleted.

2 changes: 0 additions & 2 deletions dist/index.esm.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/index.esm.js.map

This file was deleted.

6 changes: 1 addition & 5 deletions lib/highcharts.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,7 @@ export async function triggerExport(chartOptions, options, displayErrors) {
let constr = options.export.constr || 'chart';
constr = typeof Highcharts[constr] !== 'undefined' ? constr : 'chart';

Highcharts[constr](
'container',
finalOptions,
finalCallback
);
Highcharts[constr]('container', finalOptions, finalCallback);

// Get the current global options
const defaultOptions = getOptions();
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"author": "Highsoft AS <[email protected]> (http://www.highcharts.com/about)",
"license": "MIT",
"type": "module",
"version": "4.0.2",
"version": "4.0.3",
"main": "./dist/index.esm.js",
"engines": {
"node": ">=18.12.0"
Expand Down
186 changes: 107 additions & 79 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,42 +1,70 @@
<!doctype html>
<html>
<head>
<title>Highcharts Export Server</title>
<link
rel="icon"
type="image/x-icon"
href="https://www.highcharts.com/demo/static/favicon.ico"
/>

<head>
<title>Highcharts Export Server</title>
<link rel="icon" type="image/x-icon" href="https://www.highcharts.com/demo/static/favicon.ico" />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,400,700,400italic"
type="text/css"
/>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link
rel="stylesheet"
type="text/css"
href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/codemirror.css"
/>

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,400,700,400italic"
type="text/css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css"
href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/codemirror.css" />
<script
type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/codemirror.js"
integrity="sha256-nmc3i0zqNwShb7mBJjCzsMqeITv9DcHvkJ9gxmfnV+8="
crossorigin="anonymous"
></script>
<script
type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/mode/javascript/javascript.min.js"
integrity="sha256-VCI9wgJK81jD+WoGeiVQXSS7MMWqjRbZQ446hRcLmBU="
crossorigin="anonymous"
></script>
<script
type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/mode/css/css.min.js"
integrity="sha256-D5oJ11cOmRhXSYWELwG2U/XYH3YveZJr9taRYLZ2DSM="
crossorigin="anonymous"
></script>
<script type="text/javascript" src="js/main.js"></script>
</head>

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/codemirror.js"></script>
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/mode/javascript/javascript.min.js"></script>
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.20.2/mode/css/css.min.js"></script>
<script type="text/javascript" src="js/main.js"></script>
</head>
<body>
<div class="page box-size">
<div class="panel-container main-panel box-size">
<div class="panel">
<h1>Highcharts Export Server</h1>

<body>
<div class="page box-size">
<div class="panel-container main-panel box-size">
<div class="panel">
<h1>Highcharts Export Server</h1>
<p>
This page allows you to experiment with different options for the
export server. If you use the public Export Server at
<a href="https://export.highcharts.com"
>https://export.highcharts.com</a
>
you should read our
<a
href="https://www.highcharts.com/docs/export-module/privacy-disclaimer-export"
target="_blank"
>Terms of use and Fair Usage Policy.</a
>
</p>

<p>
This page allows you to experiment with different options for the
export server. If you use the public Export Server at
<a href="https://export.highcharts.com">https://export.highcharts.com</a>
you should read our <a href="https://www.highcharts.com/docs/export-module/privacy-disclaimer-export"
target="_blank">Terms of use and Fair Usage Policy.</a>
</p>

<label>Options</label>
<div class="info">Your Highcharts configuration object.</div>
<div class="error" id="error"></div>
<textarea id="options" class="codeinput box-size">
<label>Options</label>
<div class="info">Your Highcharts configuration object.</div>
<div class="error" id="error"></div>
<textarea id="options" class="codeinput box-size">
{
"xAxis": {
"categories": [
Expand Down Expand Up @@ -67,62 +95,62 @@ <h1>Highcharts Export Server</h1>
}
</textarea>

<label>Image file format</label>
<select id="format" class="box-size">
<option>image/png</option>
<option>image/jpeg</option>
<option>image/svg+xml</option>
<option>application/pdf</option>
</select>
<label>Image file format</label>
<select id="format" class="box-size">
<option>image/png</option>
<option>image/jpeg</option>
<option>image/svg+xml</option>
<option>application/pdf</option>
</select>

<label>Width</label>
<div class="info box-size">
The exact pixel width of the exported image. Defaults to chart.width
or 600px. Maximum width is 2000px.
</div>
<input type="number" class="box-size" id="width" />
<label>Width</label>
<div class="info box-size">
The exact pixel width of the exported image. Defaults to chart.width
or 600px. Maximum width is 2000px.
</div>
<input type="number" class="box-size" id="width" />

<label>Scale</label>
<div class="info box-size">
A scaling factor for a higher image resolution. Maximum scaling is
set to 4x. Remember that the width parameter has a higher precedence
over scaling.
</div>
<input type="number" id="scale" class="box-size" />
<label>Scale</label>
<div class="info box-size">
A scaling factor for a higher image resolution. Maximum scaling is
set to 4x. Remember that the width parameter has a higher precedence
over scaling.
</div>
<input type="number" id="scale" class="box-size" />

<label>Constructor</label>
<div class="info box-size">
Either a chart, stockChart, mapChart, or a ganttChart (depending on what product you use).
<label>Constructor</label>
<div class="info box-size">
Either a chart, stockChart, mapChart, or a ganttChart (depending on
what product you use).
</div>
<select id="constr">
<option>chart</option>
<option>stockChart</option>
<option>mapChart</option>
<option>ganttChart</option>
</select>
</div>
<select id="constr">
<option>chart</option>
<option>stockChart</option>
<option>mapChart</option>
<option>ganttChart</option>
</select>
</div>
</div>

<div class="panel-container chart-panel box-size">
<div class="panel" style="pointer-events: auto">
<h1>Result Preview</h1>
<div id="preview-container" class="preview-container">
<div class="info">Click the Preview button to see a preview.</div>
<div class="panel-container chart-panel box-size">
<div class="panel" style="pointer-events: auto">
<h1>Result Preview</h1>
<div id="preview-container" class="preview-container">
<div class="info">Click the Preview button to see a preview.</div>
</div>
</div>
</div>
</div>

<div class="buttons">
<button id="preview" class="button">PREVIEW</button>
<button id="download" class="button">DOWNLOAD</button>
<div class="buttons">
<button id="preview" class="button">PREVIEW</button>
<button id="download" class="button">DOWNLOAD</button>
</div>
</div>
</div>

<div class="header"></div>
</body>

<script>
highexp.init();
</script>
<div class="header"></div>
</body>

</html>
<script>
highexp.init();
</script>
</html>
Loading