├── 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 |

Sponsors & Backers

2 | 3 | swf2js.js is an MIT-licensed open source project. It's an independent project with its ongoing development made possible entirely thanks to the support by these awesome backers. If you'd like to join them, please consider: 4 | 5 |

Backers via Patreon

6 | 7 | - Tazya Kiuchi 8 | - weep 9 | - tonkatsutaro 10 | - miyag3 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2013 - 2021 swf2js 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # swf2js 2 | 3 | ## About 4 | #### [Japanese] 5 | Adobe Animate(Flash)のSWFファイルをリアルタイムで解析し、HTMLに変換するJavaScript製のFlashPlayerエミュレーターです。\ 6 | Flex,Flash,Animate、全てのプラットフォームのSWFに対応しています。 7 | 8 | #### [English] 9 | This is a JavaScript FlashPlayer emulator that analyzes SWF files of Adobe Animate (Flash) in real time and converts them to HTML.\ 10 | It supports SWFs for Flex, Flash, Animate, and all platforms. 11 | 12 | #### [Chinese] 13 | 它是一个JavaScript FlashPlayer模拟器,可以实时分析Adobe Animate (Flash) SWF文件并将其转换为HTML。\ 14 | 它支持SWF的Flex、Flash、Animate和所有平台。 15 | 16 | ## Next2D Project 17 | Next2D NoCode Tool Working Image 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 | --------------------------------------------------------------------------------