diff --git a/content/install-hook-userstylesworld.js b/content/install-hook-userstylesworld.js index 7a4bb19a..6a7ae5a6 100644 --- a/content/install-hook-userstylesworld.js +++ b/content/install-hook-userstylesworld.js @@ -16,14 +16,15 @@ && allowedOrigin === event.origin ) { sendPostMessage({type: 'usw-remove-stylus-button'}); + + if (window.location.pathname === '/api/oauth/authorize_style/new') { + API.styles.find({_linking: true}).then(style => { + console.log(style); + sendPostMessage({type: 'usw-fill-new-style', data: style}); + }); + } } }; - if (window.location.pathname === '/api/oauth/authorize_style/new') { - API.styles.find({_linking: true}).then(style => { - sendPostMessage({type: 'usw-fill-new-style', data: style}); - }); - } - window.addEventListener('message', onPageLoaded); })();