├── index.html ├── SECURITY.md ├── BACKERS.md ├── LICENSE ├── README.md ├── swf2js.user.js └── .github └── workflows └── codeql-analysis.yml /index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Reporting Security Issues 2 | 3 | If you believe you have found a security vulnerability in swf2js, we encourage you to let us know right away. We will investigate all legitimate reports and do our best to quickly fix the problem. 4 | -------------------------------------------------------------------------------- /BACKERS.md: -------------------------------------------------------------------------------- 1 |
18 |
19 | #### [Japanese]
20 | swf2jsはエミュレータとして完成し、Next2Dプロジェクトに進化していきます。
21 |
22 | #### [English]
23 | swf2js is now complete as an emulator and will evolve into the Next2D project.
24 |
25 | #### [Chinese]
26 | swf2js作为一个模拟器现在已经完成,并将发展成为Next2D项目。
27 |
28 | - [Next2D WebSite](https://next2d.app)
29 | - [Next2D NoCode Tool](https://tool.next2d.app)
30 | - [GitHub](https://github.com/Next2D)
31 |
32 | ## Website and Demo
33 | - [Japanese](https://swf2js.com)
34 | - [English](https://swf2js.com/en/)
35 | - [Chinese](https://swf2js.com/cn/)
36 |
37 | ## HTML - SAMPLE CODE
38 | ```html
39 |
40 |
43 | ```
44 |
45 | ## Project status
46 | | | Free Version | Production Version |
47 | | --- | --- | --- |
48 | | ActionScript | 1.0, 2.0 | 3.0 |
49 | | Compression | ZLIB | ZLIB/LZMA |
50 | | WebGL | × | FullWebGL |
51 | | Filters | DropShadow/Blur/Glow/Bevel | ALL Available. |
52 | | Blend Modes | 50% | ALL Available. |
53 | | Video | × | MP4/Flv(60%) |
54 |
--------------------------------------------------------------------------------
/swf2js.user.js:
--------------------------------------------------------------------------------
1 | // ==UserScript==
2 | // @name Flash Player
3 | // @namespace com.swf2js
4 | // @description Play flash (.swf) files
5 | // @homepageURL https://openuserjs.org/scripts/sjehuda/Flash_Player
6 | // @supportURL https://openuserjs.org/scripts/sjehuda/Flash_Player/issues
7 | // @updateURL https://openuserjs.org/meta/sjehuda/Flash_Player.meta.js
8 | // @copyright 2023, Schimon Jehudah (http://schimon.i2p)
9 | // @license MIT; https://opensource.org/licenses/MIT
10 | // @require https://raw.githubusercontent.com/swf2js/swf2js/4619a7e06d2863bd24ae89b11b2218f00fb32771/swf2js.js
11 | // @include *
12 | // @version 23.05
13 | // @icon data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj48dGV4dCB5PSIuOWVtIiBmb250LXNpemU9IjkwIj7imqE8L3RleHQ+PC9zdmc+Cg==
14 | // ==/UserScript==
15 |
16 | for (const element of document.querySelectorAll('embed[src$=".swf"]')) {
17 |
18 | let divElement = document.createElement('div');
19 | divElement.textContent = 'Play ⚡';// ▶️ Click to Play
20 | divElement.setAttribute('swf-data', element.src);
21 | divElement.style.height = element.closest('object').height;
22 | divElement.style.width = element.closest('object').width;
23 | divElement.style.fontSize = element.closest('object').height / 10;
24 | divElement.style.fontStyle = 'italic';
25 | divElement.style.display = 'table-cell';
26 | divElement.style.verticalAlign = 'middle';
27 | divElement.style.background = 'DarkRed';
28 | divElement.style.color = 'WhiteSmoke';
29 | divElement.style.textAlign = 'center';
30 | divElement.style.fontWeight = 'bold';
31 | divElement.style.userSelect = 'none';
32 |
33 | divElement.addEventListener ("click", function() {
34 | swf2js.load(element.src);
35 | let swfElement = document.querySelector('div[id*="swf2js_"]:last-child');
36 | swfElement.style.height = divElement.style.height;
37 | swfElement.style.width = divElement.style.width;
38 | divElement.parentNode.replaceChild(swfElement, divElement);
39 | });
40 |
41 | let orgElement = element.closest('object');
42 | insertAfter(orgElement, divElement);
43 | orgElement.remove();
44 |
45 | }
46 |
47 | // /questions/4793604/how-to-insert-an-element-after-another-element-in-javascript-without-using-a-lib
48 | function insertAfter(referenceNode, newNode) {
49 | referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
50 | }
51 |
--------------------------------------------------------------------------------
/.github/workflows/codeql-analysis.yml:
--------------------------------------------------------------------------------
1 | # For most projects, this workflow file will not need changing; you simply need
2 | # to commit it to your repository.
3 | #
4 | # You may wish to alter this file to override the set of languages analyzed,
5 | # or to provide custom queries or build logic.
6 | #
7 | # ******** NOTE ********
8 | # We have attempted to detect the languages in your repository. Please check
9 | # the `language` matrix defined below to confirm you have the correct set of
10 | # supported CodeQL languages.
11 | #
12 | name: "CodeQL"
13 |
14 | on:
15 | push:
16 | branches: [ main ]
17 | pull_request:
18 | # The branches below must be a subset of the branches above
19 | branches: [ main ]
20 | schedule:
21 | - cron: '38 23 * * 1'
22 |
23 | jobs:
24 | analyze:
25 | name: Analyze
26 | runs-on: ubuntu-latest
27 | permissions:
28 | actions: read
29 | contents: read
30 | security-events: write
31 |
32 | strategy:
33 | fail-fast: false
34 | matrix:
35 | language: [ 'javascript' ]
36 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
37 | # Learn more:
38 | # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
39 |
40 | steps:
41 | - name: Checkout repository
42 | uses: actions/checkout@v2
43 |
44 | # Initializes the CodeQL tools for scanning.
45 | - name: Initialize CodeQL
46 | uses: github/codeql-action/init@v1
47 | with:
48 | languages: ${{ matrix.language }}
49 | # If you wish to specify custom queries, you can do so here or in a config file.
50 | # By default, queries listed here will override any specified in a config file.
51 | # Prefix the list here with "+" to use these queries and those in the config file.
52 | # queries: ./path/to/local/query, your-org/your-repo/queries@main
53 |
54 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55 | # If this step fails, then you should remove it and run the build manually (see below)
56 | - name: Autobuild
57 | uses: github/codeql-action/autobuild@v1
58 |
59 | # ℹ️ Command-line programs to run using the OS shell.
60 | # 📚 https://git.io/JvXDl
61 |
62 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
63 | # and modify them (or add more) to build your code if your project
64 | # uses a compiled language
65 |
66 | #- run: |
67 | # make bootstrap
68 | # make release
69 |
70 | - name: Perform CodeQL Analysis
71 | uses: github/codeql-action/analyze@v1
72 |
--------------------------------------------------------------------------------