Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/363.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用javascript为<;提取数据;脚本>;?_Javascript_Json_Typescript - Fatal编程技术网

使用javascript为<;提取数据;脚本>;?

使用javascript为<;提取数据;脚本>;?,javascript,json,typescript,Javascript,Json,Typescript,我正在尝试制作一个chrome扩展,我想做的是在扩展中的购物网站上显示产品的条形码编号。我想在扩展中显示的数据仍保留在中 即使用javascript <script type="application/javascript"> window.__PRODUCT_DETAIL_APP_INITIAL_STATE__ = {"product":{"attributes":[],"alternativeVariants":[],"variants":[{"attributeId":

我正在尝试制作一个chrome扩展,我想做的是在扩展中的购物网站上显示产品的条形码编号。我想在扩展中显示的数据仍保留在

即使用javascript

<script type="application/javascript">
    window.__PRODUCT_DETAIL_APP_INITIAL_STATE__ = {"product":{"attributes":[],"alternativeVariants":[],"variants":[{"attributeId":0,"attributeName":"","attributeType":"","attributeValue":"","stamps":[{"type":1,"text":"KARGO BEDAVA"},{"type":3,"text":"%35"}],"price":{"profitMargin":4,"discountedPrice":{"text":"12,90 TL","value":12.9},"sellingPrice":{"text":"12,90 TL","value":12.9},"originalPrice":{"text":"19,90 TL","value":19.9},"currency":"TRY"},"attributeBeautifiedValue":"","isWinner":true,"listingId":"c2d72798d0f2c5503304cd3065bd63df","stock":null,"sellable":true,"availableForClaim":true,"barcode":"7400000422307","itemNumber":13663077}],"otherMerchants":[{"url":"/modacar/modacar-torpido-uzerine-kaydirmaz-nano-ped-422307-p-2851160?boutiqueId=316783&merchantId=119502","promotions":[],"isSellable":true,"isBasketDiscount":false,"hasStock":true,"price":{"profitMargin":4,"discountedPrice":{"text":"12,90 TL","value":12.9},"sellingPrice":{"text":"12,90 TL","value":12.9},"originalPrice":{"text":"14,90 TL","value":14.9},"currency":"TRY"},"merchant":{"id":119502,"name":"Buda Bizde","officialName":"HAMDİ ÖZKAN","cityName":" İstanbul ","taxNumber":"18377272210","sellerScore":9.2},"isFreeCargo":true,"deliveryInformation":{"isRushDelivery":false,"deliveryDate":"27 - 30 Ocak"}},{"url":"/modacar/modacar-torpido-uzerine-kaydirmaz-nano-ped-422307-p-2851160?boutiqueId=316783&merchantId=123255","promotions":[],"isSellable":true,"isBasketDiscount":false,"hasStock":true,"price":{"profitMargin":4,"discountedPrice":{"text":"12,95 TL","value":12.95},"sellingPrice":{"text":"12,95 TL","value":12.95},"originalPrice":{"text":"35,00 TL","value":35},"currency":"TRY"},"merchant":{"id":123255,"name":"MasterCar","officialName":"HAFİ ÇAĞLAR","cityName":" İstanbul ","taxNumber":"21637272516","sellerScore":9.3},"isFreeCargo":true,"deliveryInformation":{"isRushDelivery":false,"deliveryDate":"27 - 30 Ocak"}},{"url":"/modacar/modacar-torpido-uzerine-kaydirmaz-nano-ped-422307-p-2851160?boutiqueId=316783&merchantId=107808","promotions":[],"isSellable":true,"isBasketDiscount":false,"hasStock":true,"price":{"profitMargin":3,"discountedPrice":{"text":"14,90 TL","value":14.9},"sellingPrice":{"text":"14,90 TL","value":14.9},"originalPrice":{"text":"17,88 TL","value":17.88},"currency":"TRY"},"merchant":{"id":107808,"name":"Tvet","officialName":"TVET E-TİCARET KUYUM. ÇEYİZ ARACILIK VE KİR.S.VE TİC.LTD.ŞTİ.","cityName":" Zonguldak ","taxNumber":"8590632439","sellerScore":9.5},"isFreeCargo":true,"deliveryInformation":{"isRushDelivery":false,"deliveryDate":"27 - 30 Ocak"}},{"url":"/modacar/modacar-torpido-uzerine-kaydirmaz-nano-ped-422307-p-2851160?boutiqueId=316783&merchantId=106278","promotions":[],"isSellable":true,"isBasketDiscount":false,"hasStock":true,"price":{"profitMargin":3,"discountedPrice":{"text":"16,37 TL","value":16.37},"sellingPrice":{"text":"16,37 TL","value":16.37},"originalPrice":{"text":"32,73 TL","value":32.73},"currency":"TRY"},"merchant":{"id":106278,"name":"hesaplisepet","officialName":"RAMAZAN ULU","cityName":" İstanbul ","taxNumber":"39095129198","sellerScore":9},"isFreeCargo":true,"deliveryInformation":{"isRushDelivery":false,"deliveryDate":"27 - 30 Ocak"}},{"url":"/modacar/modacar-torpido-uzerine-kaydirmaz-nano-ped-422307-p-2851160?boutiqueId=316783&merchantId=118092","promotions":[],"isSellable":true,"isBasketDiscount":false,"hasStock":true,"price":{"profitMargin":4,"discountedPrice":{"text":"16,80 TL","value":16.8},"sellingPrice":{"text":"16,80 TL","value":16.8},"originalPrice":{"text":"30,55 TL","value":30.55},"currency":"TRY"},"merchant":{"id":118092,"name":"E-Marketing","officialName":"BELGÜZAR TEKERBAŞ","cityName":" İzmir ","taxNumber":"34100334154","sellerScore":8.7},"isFreeCargo":true,"deliveryInformation":{"isRushDelivery":false,"deliveryDate":"27 - 30 Ocak"}}],"campaign":{"id":316783,"name":"Oto Aksesuar","startDate":"2019-06-18T13:00:00","endDate":"2026-01-01T00:00:00","isMultipleSupplied":false,"stockTypeId":7,"url":"/oto-aksesuar/butikdetay/316783","showTimer":false},"category":{"id":103874,"name":"Torpido Aksesuarları","hierarchy":"Yaşam/Otomobil & Motosiklet/Otomobil/Araç İçi Aksesuarı/Torpido Aksesuarları","beautifiedName":"torpido-aksesuarlari"},"brand":{"id":102602,"name":"ModaCar","beautifiedName":"modacar","isVirtual":true},"color":"Karışık,Çok Renkli","showVariants":false,"id":2851160,"productCode":"7400000422307","name":"ModaCar Torpido Üzerine Kaydırmaz Nano Ped 422307 7400000422307","description":"\u003cul>\u003cli>Nano Pad ? Nano Pad(Pano,Buzdolabı,Fayans,Cam,Tahta,Pencere,Düzgün Duvar Gibi) Herhangi Bir Dikey Veya Yatay Düz Zemine Yapışır Ve Nesneleri Yerinde Tutar.Dünya Da Rakipsiz Nano Teknolojik Milyarlarca Nano Vakumlardan Oluşan Benzersiz Yüzey 90 Derecede Dahi Nesneleri Tutabilme Özelliğiürün Özellikleri : 13 X 7 Cmtüm Zeminlerde 90 Derece Dik Konumda Dahi Kullanabilmecep Telefonu,Gözlük,Kalem,Uzaktan Kumanda Cihazı,Anahtar,Demir Para Gibi Nesneleri Sabitleyebilmeyapıştığı Hiçbir Zeminde Herhangi Bir Iz Bırakmaz.Gücünü Kaybetmeye Başlayabilir – Suda Yıkayın Eski Haline Döneüzerine Koyacağınız Her Materyal,Kesinlikle Kaymaz.\u003c/li>\u003cli>Bu butikte indirim kuponları/kodları geçerli değildir.\u003c/li>\u003cli>Kampanya fiyatından satılmak üzere 10 adetten fazla stok sunulmuştur.\u003c/li>\u003cli>Ürün kartında gösterilen üstü çizili ilk fiyat tedarikçi tarafından beslenen perakende satış fiyatıdır.\u003c/li>\u003c/ul>","productGroupId":2304830,"tax":18,"businessUnit":"Oto Aksesuar","gender":{"name":"Unisex","id":3},"url":"/modacar/modacar-torpido-uzerine-kaydirmaz-nano-ped-422307-p-2851160","images":["/assets/product/media/images/20191017/19/437057/13663077/1/1_org_zoom.jpg"],"isSellable":true,"isBasketDiscount":false,"hasStock":true,"price":{"profitMargin":4,"discountedPrice":{"text":"12,90 TL","value":12.9},"sellingPrice":{"text":"12,90 TL","value":12.9},"originalPrice":{"text":"19,90 TL","value":19.9},"currency":"TRY"},"isFreeCargo":true,"promotions":[],"merchant":{"id":126041,"name":"Sincap Dükkan","officialName":"HALİT UZAN","cityName":" İstanbul ","taxNumber":"32711387002","sellerScore":9.2},"deliveryInformation":{"isRushDelivery":false,"deliveryDate":"27 - 30 Ocak"},"isMarketplace":true,"productStamps":[],"hasHtmlContent":false,"favoriteCount":581,"uxLayout":"General Merchandise"},"reviews":{"contentSummary":{"ratingCounts":[{"rate":1,"count":8},{"rate":2,"count":1},{"rate":3,"count":5},{"rate":4,"count":2},{"rate":5,"count":8}],"userCommentExist":false,"averageRating":3.04,"totalCommentCount":16,"totalRatingCount":24},"productReviews":{"totalElements":16,"totalPages":6,"page":0,"size":3,"content":[{"userFullName":"**** ****","commentDateISOtype":"2019-12-01","id":12283614,"rate":5,"commentTitle":"","comment":"Gayet güzel ben beğendim fiyatı da iyi malzeme de şyi","trusted":true,"lastModifiedDate":"1 Aralık 2019"},{"userFullName":"simge dikici","commentDateISOtype":"2019-07-31","id":3267976,"rate":5,"commentTitle":"","comment":"Telefonu gerçekten araçta kaydırmıyor. Kullanışlı bir ürün.","trusted":true,"lastModifiedDate":"31 Temmuz 2019"},{"userFullName":"**** ****","commentDateISOtype":"2019-11-14","id":8705641,"rate":5,"commentTitle":"","comment":"Çok kaliteli ve güzel","trusted":true,"lastModifiedDate":"14 Kasım 2019"}],"userCommentExist":false},"productSummary":null},"htmlContent":null,"user":{"loggedIn":false,"id":0,"isBuyer":false},"configuration":{"htmlContentCssUrl":"https://static.dsmcdn.com/frontend/pim/rich-content/production/main.cf9ab001241f21c7ffef520f9487ab4d.css","htmlContentJsUrl":"https://static.dsmcdn.com/frontend/pim/rich-content/production/main.8050003e34b702b545d67ec9d05bf408.js","storefrontId":1,"culture":"tr-TR","cdnUrl":"https://img-trendyol.mncdn.com","claimInfoText":"15 gün içinde ücretsiz iade.","ratingReviewEnabled":true,"ratingReviewLikesEnabled":true,"newRatingSummaryEnabled":false,"redirectReviewsPageEnabled":false,"languageCode":"tr","sizeCharts":[["Güneş Gözlüğü","https://img-trendyol.mncdn.com/assets/banner/2018/webBanners/bedenTablosu/gozluk_beden_tablosu.jpg","Gözlük Beden Kılavuzu"],["İmaj Gözlükleri","https://img-trendyol.mncdn.com/assets/banner/2018/webBanners/bedenTablosu/gozluk_beden_tablosu.jpg","Gözlük Beden Kılavuzu"],["Saat","https://img-trendyol.mncdn.com/assets/banner/2018/webBanners/bedenTablosu/saatler_beden_tablosu.jpg","Saat Beden Kılavuzu"]],"enhancedEcommerceEnabled":true,"addReviewEnabled":true,"reviewReportAbuseEnabled":true,"crossProductsTitle":"Bu Ürünü Alanlar Bunları da Aldı","crossProductsEnabled":true,"recommendationEnabled":true,"productGroupEnabled":true,"htmlContentEnabled":true,"productAttributesEnabled":true,"sellerAreaEnabled":true,"sellerPointLowLimit":8,"sizeChartUrl":"https://img-trendyol.mncdn.com/Assets/frontend-web-sizechart/tr1.html","productDetailMetaDescription":"Trendyol.com sayesinde {0} ürününe çok özel indirimlerle sahip olabilecek ve alışveriş alışkanlıklarınızı değiştireceksiniz.","schemaJsonEnabled":true,"siteAddress":"https://www.trendyol.com","notifyMeEnabled":true,"notifyMeCount":10,"accountGwFavoritesEnabled":true,"browsingGwUrl":"https://api.trendyol.com/webbrowsinggw","recommendationAbTestValue":"A_0-0,B_1-100,C_0-0","lastProductCountAbTestValue":"A_0-50,B_51-100","recoCardAbTestValue":"A_0-100,B_0-0","abTestingCookieName":"WebAbTesting","clientSideReviewsEnabled":false,"clientSideHtmlContentEnabled":false,"alternativeVariantsEnabled":true,"relatedCategoryEnabled":true,"relatedCategoryAbTestVariant":"C","relatedCategoryAbTestValue":"A_0-0,B_0-0,C_0-0,D_1-100,E_0-0","relatedCategoryTitleTooltipThreshold":30}};
  </script>

窗口。{uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu初始状态{“产品”{“属性”:[”属性],“替代变量”:[],“变量”:[]”,变量],“变量”:[{{“text:“12,90 TL”,“value:”12.9},“originalPrice:”{“text:”19,90 TL”,“value:”19.9},“currency:”TRY“},“attributeBeautifiedValue:”isWinner:”true,“listingId:”c2d72798d0f2c5503304cd3065bd63df”,“stock:”null,“selleble:”true,“availableForClaim:”true,“条形码:”740000042237”,“itemNumber:”13663077},“otherMerchants:”{“url:”/modacar/modacar-torpido-uzerine-kaydirmaz-nano-ped-422307-p-2851160?精品ID=316783&merchantId=119502,“促销”:[],“isSellable”:真,“Isbasket折扣”:假,“hasStock”:真,“价格”:{“利润边缘”:4,“折扣价格”:{“文本”:“12,90 TL”,“价值”:12.9},“销售价格”:{“文本”:“12,90 TL”,“价值”:12.9},“原始价格”:{“文本”:“14,90 TL“:14.9},“货币”:“TRY”},“商人”:{“id”:119502,“姓名”:“Buda Bizde”,“官方名称”:“HAMDİZKAN”,“cityName”:“İstanbul”,“taxNumber”:“18377272210”,“sellerScore”:9.2},“isFreeCargo”:true,“配送信息”:{“isRushDelivery”:false,“配送日期”:“27-30 Ocak”},{“url”:“/modacar/modacar-torpido-uzerine-kaydirmaz-nano-ped-422307-p-2851160?精品ID=316783&merchantId=123255”,“促销”:[],“isSellable”:真,“isBasketDiscount”:假,“hasStock”:真,“价格”:{“利润边缘”:4,“折扣价格”:{“文本”:“12,95 TL”,“价值”:12.95},“销售价格”:{“文本”:“12,95 TL”,“价值”:12.95},“原价”:“文本”:“35,00 TLvalue“:35}”,currency“:”TRY“}”,merchant“{”id“:123255,”name“:”MasterCar“,”officialName“:”HAFİjaĞLAR“,”cityName“:”斯坦布尔“,”taxNumber“:”2163727272516“,”sellerScore“:9.3},”isFreeCargo“:”true,“deliveryInformation“:{”isRushDelivery:”false,“deliveryDate:”27-30 Ocak“},{”url:”/modacar/modacar-torpido-uzerine-kaydirmaz-nano-ped-422307-p-2851160?精品ID=316783&merchantId=107808,“促销”:[],“isSellable”:真,“Isbasket折扣”:假,“hasStock”:真,“价格”:{“利润边缘”:3,“折扣价格”:{“文本”:“14,90 TL”,“价值”:14.9},“销售价格”:{“文本”:“14,90 TL”,“价值”:14.9},“原始价格”:{“文本”17,88 TL“:17.88},“货币”:“TRY”},“商人”:{“id”:107808,“姓名”:“Tvet”,“官方名称”:“Tvet E-TİCARET KUYUM.İez ARACILIK VE KİR.S.VE TİC.LTD.ŞTİ。”,“城市名称”:“Zonguldak”,“税号”:“8590632439”,“sellerScore”:9.5},“isFreeCargo”:真,“交货信息”:“isRushDelivery”:假,“交货日期”:“27-30}“/modacar/modacar-torpido-uzerine-kaydirmaz-nano-ped-422307-p-2851160?精品ID=316783&merchantId=106278”,“促销”:[],“isSellable”:真,“Isbasket折扣”:假,“hasStock”:真,“价格”:{“利润边缘”:3,“折扣价格”:{“文本”:“16,37 TL”,“价值”:16.37},“销售价格”:{“文本”:“16,37 TL”,“价值”:16.37},“原始价格”:“文本”:“32,73”{value:32.73},“货币”:“TRY”},“商人”:{“id”:106278,“姓名”:“hesaplisepet”,“官方名称”:“RAMAZAN ULU”,“cityName”:“İstanbul”,“taxNumber”:“39095129198”,“sellerScore”:9},“isFreeCargo”:true,“deliveryInformation”:{“isRushDelivery”:false,“deliveryDate”:“27-30 Ocak”},{“url”:/modacar/modacar-torpido-uzerine-kaydirmaz-nano-ped-422307-p-2851160?精品ID=316783&merchantId=118092,“促销”:[],“isSellable”:真,“Isbasket折扣”:假,“hasStock”:真,“价格”:{“利润边缘”:4,“折扣价格”:{“文本”:“16,80 TL”,“价值”:16.8},“销售价格”:{“文本”:“16,80 TL”,“价值”:16.8},“原始价格”:{“文本”30,55 TL“:30.55},“货币”:“TRY”},“商户”:{“id”:118092,“名称”:“电子营销”,“官方名称”:“BELGÜZAR TEKERBAŞ”,“城市名称”:“İzmir”,“税号”:“34100334154”,“卖家核心”:8.7},“isFreeCargo”:true,“配送信息”:{“isRushDelivery”:false,“配送日期”:“27-30 Ocak}”,“活动”:{“id”:316783,“名称”:“Oto Akseseuar”,“startDate”:”“2019-06-18T13:00:00”,“结束日期”:“2026-01-01T00:00:00”,“isMultipleSupplied”:false,“stockTypeId”:7,“url”:“/oto-Aksuar/butikdetay/316783”,“showTimer”:false},“category”:{“id”:103874,“姓名”:“Torpido-Aksuarları”,“等级制度”:“Ya am/Otomobil&Motosiklet/Otomobil/Araçi Aksuarıi Aksuarı/Torpido Aksuarları”;“Beautorar”品牌:{“id”:102602,“名称”:“ModaCar”,“beautifiedName”:“ModaCar”,“isVirtual”:true},“颜色”:“Karıık,Chok Renkli”,“showVariants”:false,“id”:2851160,“产品代码”:“740000042237”,“名称”:“ModaCar TorpidoÜzerine Kaydırmaz Nano Ped 422307 740000042237”,“说明”:“\u003cul>\u003cli(帕诺、布兹多拉布、法扬斯、卡姆、塔塔、彭塞尔、杜瓦尔吉比)他说,他是一位年轻的工程师。他是米利亚拉卡纳米技术公司纳米瓦库马拉和奥卢兹·本泽西公司的工程师,90年前从泽利克勒里大学毕业的:13 X 7 Cmt泽明勒尔90年前从库兰梅切普电信公司、格兹兰达、卡鲁齐、卡鲁奇和卡鲁奇公司毕业的5月5日,阿纳图尔、阿纳图尔、阿纳图尔和其他非政府组织和其他非政府组织和其他非政府组织的非政府组织的非政府组织的非政府组织(5月5日)和阿纳图尔(5月5日)、阿纳图图尔、阿纳图图尔、阿纳图图尔、阿纳图图尔、阿纳图尔和阿图图尔和阿图图尔和阿图图图图图图图尔和阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿图阿li>\u003cli>坎帕尼亚菲亚特安达·萨特莱恩达·格斯特里伦·斯特里泽尔10阿迪滕·法兹拉·斯托克·苏努尔穆·图尔.\u003c/li>\u003cli>rün卡丁·格斯特里伦·斯特里伦·斯特里泽尔·菲亚特·塔拉夫·贝斯莱恩·佩拉肯德·萨特莱恩·菲亚特·德·德雷.\u003c/li>\u003c/ul奥托>“,“productGroupId”:4830,“税务单位”,18,“性别”,“塞萨科里夫”和“塞萨科莱克斯”:“Unix”:“Uniid”:/modacar/modacar-torpido-uzerine-kaydirmaz-nano-ped-422307-p-28511
document.querySelector('script[type="application/javascript"]')