ruffle-rs / ruffle

A Flash Player emulator written in Rust
https://ruffle.rs
Other
15.56k stars 807 forks source link

Need help in getting this to talk with a Stanley tool controller #3027

Open cbr7703 opened 3 years ago

cbr7703 commented 3 years ago

Hi need help in getting this to talk with a Stanley tool controller. They use Chrome with flash and Java to have a two-way commutation by typing in the controllers IP address. I installed Ruffle extension and the top of the page will load but the settings area is just spinning. Here is what I'm working on, http://www.jountool.com/products/QA/QAALPHA_MANUAL_ENU.pdf I would be more than happy to make a donation if we can get this to work.

I received error is Ruffle ext. (()=>{var e={495:e=>{e.exports={getI18nString:function(e){return chrome&&chrome.i18n&&chrome.i18n.getMessage?chrome.i18n.getMessage(e):browser&&browser.i18n&&browser.i18n.getMessage?browser.i18n.getMessage(e):void console.error("Can't get i18n message: "+e)},setSyncStorage:function(e){chrome&&chrome.storage&&chrome.storage.sync&&chrome.storage.sync.set?chrome.storage.sync.set(e):browser&&browser.storage&&browser.storage.sync&&browser.storage.sync.set?browser.storage.sync.set(e):console.error("Can't set settings.")},getSyncStorage:function(e,r){let o;o="string"==typeof e?[e]:Array.isArray(e)?e:Object.keys(e);let n=e=>{for(const r of o)void 0===e[r]&&(e[r]=t[r]);return r(e)};chrome&&chrome.storage&&chrome.storage.sync&&chrome.storage.sync.get?chrome.storage.sync.get(e,n):browser&&browser.storage&&browser.storage.sync&&browser.storage.sync.get?browser.storage.sync.get(e,n):console.error("Couldn't read setting: "+e)},reloadTab:function(e,t){chrome&&chrome.tabs&&chrome.tabs.reload?chrome.tabs.reload(e,t):browser&&browser.tabs&&browser.tabs.reload?browser.tabs.reload(e,t):console.error("Couldn't reload tab.")},dictEquality:function(e,t){let r=!0;for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r=r&&e[o]===t[o]);for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r=r&&e[o]===t[o]);return r},tabQuery:function(){let e=arguments;return window.browser&&browser.tabs&&browser.tabs.query?browser.tabs.query.apply(this,arguments):new Promise((function(t){let r=Array.prototype.slice.call(e);r.push(t),chrome.tabs.query.apply(this,r)}))},tabSendmessage:function(){let e=arguments;return window.browser&&browser.tabs&&browser.tabs.sendMessage?browser.tabs.sendMessage.apply(this,arguments):new Promise((function(t,r){let o=Array.prototype.slice.call(e);o.push((function(e){void 0!==chrome.runtime.lastError&&r(chrome.runtime.lastError.message),t(e)})),chrome.tabs.sendMessage.apply(this,o)}))},addStorageChangeListener:function(e){chrome&&chrome.storage&&chrome.storage.onChanged&&chrome.storage.onChanged.addListener?chrome.storage.onChanged.addListener(e):browser&&browser.storage&&browser.storage.onChanged&&browser.storage.onChanged.addListener?browser.storage.onChanged.addListener(e):console.error("Couldn't add setting change listener")},openSettingsPage:function(){chrome&&chrome.tabs&&chrome.tabs.create?chrome.tabs.create({url:"/settings.html"}):browser&&browser.runtime&&browser.runtime.openOptionsPage?browser.runtime.openOptionsPage():console.error("Can't open settings page")},setMessageListener:function(e){chrome&&chrome.runtime&&chrome.runtime.onMessage&&chrome.runtime.onMessage.addListener?chrome.runtime.onMessage.addListener(e):browser&&browser.runtime&&browser.runtime.onMessage&&browser.runtime.onMessage.addListener?browser.runtime.onMessage.addListener(e):console.error("Couldn't add message listener")},getExtensionUrl:function(){return chrome&&chrome.extension&&chrome.extension.getURL?chrome.extension.getURL("dist/ruffle.js").replace("dist/ruffle.js",""):browser&&browser.runtime&&browser.runtime.getURL?browser.runtime.getURL("dist/ruffle.js").replace("dist/ruffle.js",""):void console.error("Couldn't get extension URL")},camelize:function(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,((e,t)=>t.toUpperCase()))}};const t={ruffleEnable:!0,ignoreOptout:!1}}},t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={exports:{}};return eo,n.exports}(()=>{const{getI18nString:e,setSyncStorage:t,getSyncStorage:o,addStorageChangeListener:n,reloadTab:s,dictEquality:a,tabQuery:i,tabSendmessage:c,openSettingsPage:g,camelize:l}=r(495);let d,u,b={},m={};function h(){let e=!a(b,m);void 0!==d&&(d.disabled=!e)}function w(r){let s=r.name;r.nextSibling.textContent=e("settings_"+s),s=l(s),o(s,(function(e){r.checked=e[s],b[s]=e[s],h()})),n((function(e){Object.prototype.hasOwnProperty.call(e,s)&&(r.checked=e[s].newValue,b[s]=e[s].newValue,h())})),r.addEventListener("click",(function(){let e={};e[s]=r.checked,b[s]=e[s],h(),t(e)}))}async function p(){let t=document.getElementById("ruffle_status");t.textContent=e("status_init");let r=null;try{if(r=await i({currentWindow:!0,active:!0}),r.length<1)return void(t.textContent=e("status_no_tabs"));r.length>1&&console.warn("Got "+r.length+" tabs in response to active tab query")}catch(r){throw t.textContent=e("status_tabs_error"),r}try{u=r[0],t.textContent=e("status_message_init");let o=await c(u.id,{action:"get_page_options"});m=o.tabSettings,h(),void 0!==o&&o.loaded?t.textContent=e("status_result_running"):void 0===o||o.loaded?t.textContent=e("status_result_error"):m.ruffleEnable?t.textContent=e("status_result_optout"):t.textContent=e("status_result_disabled")}catch(r){throw t.textContent=e("status_result_protected"),d&&(d.disabled=!0),r}}document.addEventListener("DOMContentLoaded",(function(){var t,r=document.getElementById("settingsbutton");w(document.getElementById("ruffle_enable")),w(document.getElementById("ignoreoptout")),(t=document.getElementById("reload")).textContent=e("action"+t.id),t.disabled=!0,t.addEventListener("click",(function(){s(u.id,(function(){window.setInterval(p,1e3)}))})),d=t,r.innerHTML=e("open_settings_page"),r.onclick=g,p()}))})()})();

Poopooracoocoo commented 3 years ago

What's a Stanley tool controller? Some more information there would be helpful for the developers.

Screenshots of what the Flash program for it look like in Ruffle and should look like would helpful too.

Could you paste the error logs from the console in developer tools in Chrome? The errors you pasted seem to be very Chrome-extension orientated and hard to understand, although I'm not a Ruffle developer.

Page 107 of that PDF describes a bit about the program, but I'm still super confused.

It doesn't sound like this can be reproduced on the developers' side as it sounds like they'll need a Stanley tool controller to get to the SWF and interact with it.

cbr7703 commented 3 years ago

Sorry I am just a user so I will provide what details I can. The Stanley controller controls a torque tool, it can be viewed or changed via Chrome with java and flash. So it is a 2-way comm link. Here I am connected directly to the controller via crossover cable and access by IP address. I am attaching what the page looks like when its working on a old PC and what I get now with a new PC and Ruffle extension. Let me see if my friend can help me get the SWF Stanley page not working on new PC Stanley page working on old PC

Poopooracoocoo commented 3 years ago

Thank you for the screenshots! :D I don't know what a torque tool is though. :/

You can open Chrome's developer tools by going to Chrome's menu, clicking on 'more tools', and then clicking on 'developer tools'. (The ctrl+shift+i keyboard shortcut doesn't always work with Ruffle). You can then navigate to the console tab to view Ruffle's output. :)

You could, by the way, use another browser that hasn't removed support for Flash such as Waterfox and see if that works.

cbr7703 commented 3 years ago

Here what I see on the console of the PC that won't work, I loaded the swf my buddy found, renamed it txt file. ET Removed swf ext.txt

Failed to load resource: the server responded with a status of 404 () VM16:3 Error creating WebGL renderer: Unable to create WebGL rendering context s.wbg.__wbg_error_e325755affc8634b @ VM16:3 VM16:3 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu (anonymous) @ VM16:3 VM16:3 New Ruffle instance created. VM16:3 Loading SWF file et.swf?session=2124595200066231&etport=Local

cbr7703 commented 3 years ago

Not sure if I doing this right, downloaded Waterfox and Ruffle, same results as Chrome the top of the page opens and the setting area below is spinning. I got this message in the console.

The script from “http://192.168.5.2/js/util.js?session=213401600001092758” was loaded even though its MIME type (“text/plain”) is not a valid JavaScript MIME type. 192.168.5.2 The script from “http://192.168.5.2/swfobject.js?session=213401600001092758” was loaded even though its MIME type (“text/plain”) is not a valid JavaScript MIME type. 192.168.5.2 The script from “http://192.168.5.2/js/xmltoken.js?session=213401600001092758” was loaded even though its MIME type (“text/plain”) is not a valid JavaScript MIME type. 192.168.5.2 The script from “http://192.168.5.2/js/dom.js?session=213401600001092758” was loaded even though its MIME type (“text/plain”) is not a valid JavaScript MIME type. 192.168.5.2 The script from “http://192.168.5.2/js/xpath.js?session=213401600001092758” was loaded even though its MIME type (“text/plain”) is not a valid JavaScript MIME type. 192.168.5.2 The script from “http://192.168.5.2/js/xslt.js?session=213401600001092758” was loaded even though its MIME type (“text/plain”) is not a valid JavaScript MIME type. 192.168.5.2 The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol. 192.168.5.2 New Ruffle instance created. 192.168.5.2:3:47577 Loading SWF file et.swf?session=213401600001092758&etport=Local 192.168.5.2:3:49255

Poopooracoocoo commented 3 years ago

@cbr7703 You can't use Ruffle in Waterfox Classic. Waterfox Classic lets you use the Adobe Flash plugin. Waterfox Classic is incompatible with Ruffle as it keeps old code that new code isn't compatible with. :)

Edit: there's also Basilisk and Pale Moon. I think those two also let you use Adobe Flash.

Just as a workaround until Ruffle supports it...