Skip to content

Commit

Permalink
🔥 Update Fairground network to not be an open proxy (#39544)
Browse files Browse the repository at this point in the history
* Update Fairground network to not be an open proxy

* Fix linter issues

* 📦 Update github/codeql-action action to v2.22.2 (#39545)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
wdmtech and renovate[bot] authored Oct 12, 2023
1 parent ce285ca commit 417fc42
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
16 changes: 13 additions & 3 deletions ads/vendors/fairground.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
import {loadScript, validateData} from '#3p/3p';
import {validateData} from '#3p/3p';

/**
* @param {!Window} global
* @param {!Object} data
*/
export function fairground(global, data) {
validateData(data, ['src']);
loadScript(global, data['src']);
validateData(data, ['project', 'hash']);

const c = document.createElement('script');
c.src =
'https://amp.thefairground.com/' +
data.project +
'/' +
data.hash +
'/amp.script.js';
c.type = 'text/javascript';

global.document.getElementsByTagName('body')[0].append(c);
}
5 changes: 3 additions & 2 deletions ads/vendors/fairground.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ Provides support for Fairground ads.

### Required parameters

- `src`
- `project`
- `hash`

## Example

```html
<amp-ad width="320" height="100" layout="fixed" type="fairground"
src="https://amp.thefairground.com/campaigns/4189dd42-f853-4535-aedd-7130ea601fd8/amp.script.js">
data-project="campaigns" data-hash="4189dd42-f853-4535-aedd-7130ea601fd8">
</amp-ad>
```
2 changes: 1 addition & 1 deletion examples/amp-ad/ads.amp.html
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ <h2>Ezoic</h2>

<h2>Fairground</h2>
<amp-ad width="320" height="100" layout="fixed" type="fairground"
src="https://amp.thefairground.com/campaigns/4189dd42-f853-4535-aedd-7130ea601fd8/amp.script.js">
data-project="campaigns" data-hash="4189dd42-f853-4535-aedd-7130ea601fd8">
</amp-ad>

<h2>FlexOneELEPHANT</h2>
Expand Down

0 comments on commit 417fc42

Please sign in to comment.